svelte-gantt
svelte-gantt copied to clipboard
Can svelte-gantt be used in SSR?
Right now svelte-gantt is used in onMount
only for client-side rendering, is it possible for it to render server side as well and not rely on document
?
Adding is it possible to use with sveltekit?
Concerning the SSR, I think the current structure doesn't allow it. But you can of course use it with sveltekit since you it's compiled in pure js. Did you run into a problem doing so ?
Concerning the SSR, I think the current structure doesn't allow it. But you can of course use it with sveltekit since you it's compiled in pure js. Did you run into a problem doing so ?
not until the new update im getting this error (node:19828) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. (Use
node --trace-warnings ...` to show where the warning was created)
Unexpected token 'export'
C:\Users\node_modules\svelte-gantt\index.js:7180
export { MomentSvelteGanttDateAdapter, SvelteGantt, SvelteGanttDependencies, SvelteGanttExternal, SvelteGanttTable };
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1027:15)
at Module._compile (node:internal/modules/cjs/loader:1063:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap. this also shows every server start
svelte-gantt doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.`
Hey I've also encountered this issue, I've discovered it because this packages is not quite conforming to the node.js module spec https://github.com/vitejs/vite/issues/5939#issuecomment-985176340
easy fix is to add "type": "module"
to the package.json