svelte-swiper
svelte-swiper copied to clipboard
ReferenceError: window is not defined
@patricknelson I was trying to use the svelte-swiper and it's not showing anything. I see the referenceError in the console.
No description provided.
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.