You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running npm run build on a SvelteKit project that uses Swiper will throw a build error. I noticed that this doesn't happen with adapter-auto, but with adapter-node.
I saw a similar error described on the issue #3015 but it was closed because it looks like a problem with Swiper but the issue #5288 on the Swiper repository was also closed (I didn't quite understand the reason), so I'm opening a new one with a better description and easy way to reproduce.
I'm still not sure if this is a problem with SvelteKit or with Swiper, but since this appears to only happen with the node adapter, I think it makes sense to be discussed here.
Reproduction
Start a new SvelteKit project
Install swiper and @sveltejs/adapter-node@next
In "svelte.config.js", change the adapter to import from @sveltejs/adapter-node
In "src/routes/index.svelte", use Swiper normally, like in this example from their docs:
> Using @sveltejs/adapter-node
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".css"for F:\Projetos HDD\temp-test-swiper\node_modules\swiper\swiper.min.css
at new NodeError (internal/errors.js:322:7)
at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:71:15)
at Loader.getFormat (internal/modules/esm/loader.js:105:42)
at Loader.getModuleJob (internal/modules/esm/loader.js:243:31)
at async ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:78:21)
at async Promise.all (index 2)
at async link (internal/modules/esm/module_job.js:83:9)
> 500 /
Error: 500 /
at file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/kit/dist/chunks/index4.js:86:11
at visit (file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/kit/dist/chunks/index4.js:222:5)
at async prerender (file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/kit/dist/chunks/index4.js:303:6)
at async Object.prerender (file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/kit/dist/chunks/index4.js:368:4)
at async adapt (file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/adapter-node/index.js:111:4)
at async adapt (file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/kit/dist/chunks/index4.js:393:2)
at async file:///F:/Projetos%20HDD/temp-test-swiper/node_modules/@sveltejs/kit/dist/cli.js:896:5
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Describe the bug
Running
npm run build
on a SvelteKit project that uses Swiper will throw a build error. I noticed that this doesn't happen withadapter-auto, but with adapter-node.I saw a similar error described on the issue #3015 but it was closed because it looks like a problem with Swiper but the issue #5288 on the Swiper repository was also closed (I didn't quite understand the reason), so I'm opening a new one with a better description and easy way to reproduce.
I'm still not sure if this is a problem with SvelteKit or with Swiper, but since this appears to only happen with the node adapter, I think it makes sense to be discussed here.
Reproduction
swiper
and@sveltejs/adapter-node@next
@sveltejs/adapter-node
npm run build
Logs
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: