Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can svelte-gantt be used in SSR? #44

Open
winston0410 opened this issue Nov 21, 2021 · 4 comments
Open

Can svelte-gantt be used in SSR? #44

winston0410 opened this issue Nov 21, 2021 · 4 comments
Labels
question Further information is requested

Comments

@winston0410
Copy link

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?

@V-Py V-Py added the question Further information is requested label May 1, 2022
@Avi-ADAM
Copy link

Adding is it possible to use with sveltekit?

@V-Py
Copy link
Collaborator

V-Py commented Jun 15, 2022

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 ?

@Avi-ADAM
Copy link

Avi-ADAM commented Sep 12, 2022

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. (node:internal/modules/esm/translators:170:29)
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:409:24) this also shows every server startsvelte-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.`

@Jakeii
Copy link

Jakeii commented Mar 11, 2023

Hey I've also encountered this issue, I've discovered it because this packages is not quite conforming to the node.js module spec vitejs/vite#5939 (comment)

easy fix is to add "type": "module" to the package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants