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

Does not work with Sveltekit #66

Closed
cbishop opened this issue Apr 14, 2022 · 2 comments
Closed

Does not work with Sveltekit #66

cbishop opened this issue Apr 14, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@cbishop
Copy link

cbishop commented Apr 14, 2022

I tried svelte-jsoneditor with Sveltekit and got the following error. Just thought you might like to know. Looks like a great project you've got going.

document is not defined
ReferenceError: document is not defined
at /Volumes/Userdata/Users/clarke/dev/svelte/auth-kit/node_modules/vanilla-picker/dist/vanilla-picker.js:1000:19
at /Volumes/Userdata/Users/clarke/dev/svelte/auth-kit/node_modules/vanilla-picker/dist/vanilla-picker.js:9:83
at Object. (/Volumes/Userdata/Users/clarke/dev/svelte/auth-kit/node_modules/vanilla-picker/dist/vanilla-picker.js:12:3)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap. (node:internal/modules/esm/translators:168:29)
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at async Promise.all (index 0)
document is not defined
ReferenceError: document is not defined
at /Volumes/Userdata/Users/clarke/dev/svelte/auth-kit/node_modules/vanilla-picker/dist/vanilla-picker.js:1000:19
at /Volumes/Userdata/Users/clarke/dev/svelte/auth-kit/node_modules/vanilla-picker/dist/vanilla-picker.js:9:83
at Object. (/Volumes/Userdata/Users/clarke/dev/svelte/auth-kit/node_modules/vanilla-picker/dist/vanilla-picker.js:12:3)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap. (node:internal/modules/esm/translators:168:29)
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at async Promise.all (index 0)

@josdejong
Copy link
Owner

Maybe you have to turn off SSR. I'm not that familiar with all the SSR stuff myself yet so I'm not sure.

@josdejong
Copy link
Owner

I've enabled SSR in the development environment and made it work by importing vanilla-picker dynamically (it relies on document, which is not available server side).

Can you try out v0.3.40? I think the SSR issue is fixed.

@josdejong josdejong added the bug Something isn't working label Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants