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

ReferenceError: window is not defined #9

Open
Absleepy opened this issue Jul 6, 2023 · 2 comments
Open

ReferenceError: window is not defined #9

Absleepy opened this issue Jul 6, 2023 · 2 comments

Comments

@Absleepy
Copy link

Absleepy commented Jul 6, 2023

@patricknelson I was trying to use the svelte-swiper and it's not showing anything. I see the referenceError in the console.

@patricknelson
Copy link

No description provided.

@NikolayMakhonin
Copy link

NikolayMakhonin commented Sep 18, 2023

Please add the ability to use svelte SSR.

Internal server error: window is not defined
      at Object.<anonymous> (\node_modules\.pnpm\[email protected]\node_modules\svelte-swiper\dist\bundle.js:1:224)

I think to solve this issue, you need to add the option output: { globalObject: 'this' } in webpack.config.js.

Additionally, I'd recommend adding the package.json.lock file to the repository, locking down all dev dependencies, and update them manually only. I tried compiling the project just now and couldn't, no matter what I did. I encountered a lot of unclear errors, and it feels easier to just rebuild the whole bundler from scratch. For my own use, I've decided to simply copy the component files into my project.

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

No branches or pull requests

3 participants