ANovokmet / svelte-gantt

:calendar: Interactive JavaScript Gantt chart/resource booking component

Home Page:https://anovokmet.github.io/svelte-gantt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svelteRouting is not defined

kesyous opened this issue · comments

i can start app with "npm run demo:start" but get svelteRouting is not defined error with "npm run demo:dev"

svelte-gantt

commented

can you tell me which version of svelte-gantt you're using ? If you were on the 4.0.8-beta; change for the 4.0.9 or the 4.0.7 to see if it's working

Svelte gantt version is 4.0.9 beta

I'll get this issue too (v4.0.9-beta).

Edit:
Building the project with node tools/build gives this error:

C:\GitHub\external-libs\svelte-gantt>node tools/build
Error: C:/GitHub/external-libs/svelte-gantt/src/core/store.ts(113,43): semantic error TS2344: Type 'SvelteRow' does not satisfy the constraint 'EntityType'.
  The types of 'model.id' are incompatible between these types.
    Type 'string | number' is not assignable to type 'number'.
      Type 'string' is not assignable to type 'number'.
    at error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:5265:30)
    at throwPluginError (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:17972:12)
    at Object.error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:18579:24)
    at Object.error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:18141:38)
    at RollupContext.error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:17192:30)
    at C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:24953:23
    at arrayEach (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:532:11)
    at forEach (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:9358:14)
    at printDiagnostics (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:24926:5)
    at Object.transform (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:26841:17)
(node:68916) UnhandledPromiseRejectionWarning: Error: C:/GitHub/external-libs/svelte-gantt/src/core/store.ts(113,43): semantic error TS2344: Type 'SvelteRow' does not satisfy the constraint 'EntityType'.
  The types of 'model.id' are incompatible between these types.
    Type 'string | number' is not assignable to type 'number'.
      Type 'string' is not assignable to type 'number'.
    at error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:5265:30)
    at Object.error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:18579:24)
    at Object.error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup\dist\shared\rollup.js:18141:38)
    at RollupContext.error (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:17192:30)
    at C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:24953:23
    at arrayEach (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:532:11)
    at forEach (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:9358:14)
    at printDiagnostics (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:24926:5)
    at Object.transform (C:\GitHub\external-libs\svelte-gantt\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:26841:17)
(node:68916) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

To solve the problem I had to edit the store.ts file adding | string to the model type:

interface EntityType {
  model: { id: number | string }
}

Then I could start the project with npm run demo:dev.
npm run demo:start works fine now.

commented

You can do a PR on this if you want, otherwise I'll try to integrate it asap, but I'm currently working on a new SvelteKit version of the demo to have a clean update

There were some changes in v4.1 which fix this issue.