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

Fix for importing plugin with SvelteKit & SSR #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dkd0m
Copy link

@dkd0m dkd0m commented Nov 19, 2023

Importing this plugin in SvelteKit causes a ReferenceError because "navigator" seems to be defined in a SSR context.
I just added an additional check if "document" is defined in "createPosterWrapperView.js".

@rikschennink
Copy link
Collaborator

Which version of SvelteKit?

@dkd0m
Copy link
Author

dkd0m commented Nov 20, 2023

I tested it on a blank project with npm create svelte@latest
"@sveltejs/kit": "^1.27.4",
"svelte": "^4.0.,
"vite": "^4.4.2"

@rikschennink
Copy link
Collaborator

I'll run some tests and will get back to you

@rikschennink
Copy link
Collaborator

I'v tried to reproduce it in this project but it just works? Maybe I'm missing something.
https://github.com/pqina/pintura-example-sveltekit

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

Successfully merging this pull request may close these issues.

2 participants