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 SSR #977

Open
Sparkier opened this issue Nov 18, 2024 · 5 comments · May be fixed by vega/vega-embed#1366
Open

Does not work with SvelteKit SSR #977

Sparkier opened this issue Nov 18, 2024 · 5 comments · May be fixed by vega/vega-embed#1366
Labels
bug Something isn't working

Comments

@Sparkier
Copy link
Collaborator

Sparkier commented Nov 18, 2024

vega-embed depends on json-stringily-pretty-compact, but that does not work when SSR is enabled:

SyntaxError: Cannot use import statement outside a module

Disabling SSR via export const ssr = false; will fix things, but that is certainly not ideal.

@Sparkier Sparkier added the bug Something isn't working label Nov 18, 2024
@domoritz
Copy link
Member

Looks like we only use it for the "view source" in https://github.com/vega/vega-embed/blob/2dfdf591c86462077fc780dd717d40681ffed6aa/src/embed.ts#L4. It's a super simple library: https://github.com/lydell/json-stringify-pretty-compact/blob/main/index.js. Maybe if we update to v4, this issue goes away since that's esm?

@Sparkier
Copy link
Collaborator Author

Could very well be. Are you planning to update vega-embed to v4? If so, I can test.

@domoritz
Copy link
Member

Done. Try 6.29.0.

@Sparkier
Copy link
Collaborator Author

Still getting:
Image

Not much more time to explore further today. Can look into it again later this week.

@domoritz
Copy link
Member

Thanks for trying and thanks for pushing me to finally update this dependency across our stack.

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

Successfully merging a pull request may close this issue.

2 participants