Home / GitHub Page

Type script errors

I'm getting these with git dev 30543104b:

[16:30:28] Starting 'tsc'...
ElectronClient/gui/MainScreen/commands/newTodo.ts(16,58): error TS2554: Expected 1 arguments, but got 2.
ElectronClient/gui/NoteEditor/commands/focusElementNoteBody.ts(7,2): error TS2322: Type '{ name: string; label: () => any; parentLabel: () => any; }' is not assignable to type 'CommandDeclaration'.
  Object literal may only specify known properties, and 'parentLabel' does not exist in type 'CommandDeclaration'.
ElectronClient/gui/NoteEditor/commands/focusElementNoteTitle.ts(7,2): error TS2322: Type '{ name: string; label: () => any; parentLabel: () => any; }' is not assignable to type 'CommandDeclaration'.
  Object literal may only specify known properties, and 'parentLabel' does not exist in type 'CommandDeclaration'.
ElectronClient/gui/NoteListControls/NoteListControls.tsx(34,60): error TS2345: Argument of type 'import("/Users/tessus/data/work/joplin/ElectronClient/lib/services/CommandService").CommandRuntime' is not assignable to parameter of type 'import("/Users/tessus/data/work/joplin/ReactNativeClient/lib/services/CommandService").CommandRuntime'.
  The types returned by 'execute(...)' are incompatible between these types.
    Type 'void' is not assignable to type 'Promise<any>'.
ElectronClient/gui/SideBar/commands/focusElementSideBar.ts(7,2): error TS2322: Type '{ name: string; label: () => any; parentLabel: () => any; }' is not assignable to type 'CommandDeclaration'.
  Object literal may only specify known properties, and 'parentLabel' does not exist in type 'CommandDeclaration'.
[16:30:35] 'tsc' errored after 6.32 s

You might want to clean your build directories and rebuild as there are many TypeScript changes in this release so the compiler might get confused if there are old files lying around.

How do I do that? e.g. in the ElectronClient/build dir are only images.

But I removed all files that were untracked after doing the latest git pull.

Running npm run copyLib from the root might help as it will clear the lib and replace it with the latest version.

That did it.