-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Navigation buttons do not respond in SvelteKit #4574
Comments
Can you try importing swiper core and navigation explicitly from file: import SwiperCore, { Navigation } from "swiper/swiper.esm.js"; |
Vanilla Svelte handles this fine. This is how SvelteKit behaves on npm run dev:
I did a little debugging and found this thread that seemed relevant: mhkeller/layercake#41, but I tried some of the solutions mentioned there (install as devDependency, and svelte.config.js config.kit.vite.optimizeDeps.include = ['swiper']) and neither of them had any effect. I also tried running it as a production build (npm run build -> npm run preview) and got this error with
And this error with
|
I found a way to solve it, I'm passing you the code that I implemented in svelte kit.
|
any news? still having this issue, the above solution looks ugly |
fixed in #4768 |
SvelteKit is still in beta, and this could possibly be a SvelteKit issue and not a Swiper issue. I'll report it to them if that is the case.
What You Did
https://codesandbox.io/s/quiet-cache-4crt9?file=/App.svelte
Then I took this App.svelte and used it as index.svelte in a SvelteKit skeleton. To reproduce:
npm init svelte@next (skeleton project -> no -> no -> no)
npm install
npm install swiper
npm run dev
copy code from codesandbox to src/routes/index.svelte
Expected Behavior
Navigation buttons should work as in codesandbox
Actual Behavior
Navigation buttons appear but do not respond or enter the disabled state. Seems to work otherwise.
The text was updated successfully, but these errors were encountered: