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

SvelteKit deployment issue w/ Swiper #3015

Closed
onderbakirtas opened this issue Dec 10, 2021 · 3 comments
Closed

SvelteKit deployment issue w/ Swiper #3015

onderbakirtas opened this issue Dec 10, 2021 · 3 comments

Comments

@onderbakirtas
Copy link

onderbakirtas commented Dec 10, 2021

Describe the bug

The project doesn't build and deploy on Vercel and CloudFlare, it does work on local.

Reproduction

https://github.com/onderbakirtas/upo

Logs

> Using @sveltejs/adapter-vercel
 > node_modules/swiper/svelte/swiper-svelte.js:14:24: error: No loader is configured for ".svelte" files: node_modules/swiper/svelte/swiper-slide.svelte
    14 │ import SwiperSlide from './swiper-slide.svelte';~~~~~~~~~~~~~~~~~~~~~~~
 > node_modules/swiper/svelte/swiper-svelte.js:13:19: error: No loader is configured for ".svelte" files: node_modules/swiper/svelte/swiper.svelte
    13 │ import Swiper from './swiper.svelte';~~~~~~~~~~~~~~~~~
> Build failed with 2 errors:
node_modules/swiper/svelte/swiper-svelte.js:13:19: error: No loader is configured for ".svelte" files: node_modules/swiper/svelte/swiper.svelte
node_modules/swiper/svelte/swiper-svelte.js:14:24: error: No loader is configured for ".svelte" files: node_modules/swiper/svelte/swiper-slide.svelte
Error: Build failed with 2 errors:
node_modules/swiper/svelte/swiper-svelte.js:13:19: error: No loader is configured for ".svelte" files: node_modules/swiper/svelte/swiper.svelte
node_modules/swiper/svelte/swiper-svelte.js:14:24: error: No loader is configured for ".svelte" files: node_modules/swiper/svelte/swiper-slide.svelte
    at failureErrorWithLog (/vercel/path0/node_modules/esbuild/lib/main.js:1493:15)
    at /vercel/path0/node_modules/esbuild/lib/main.js:1151:28
    at runOnEndCallbacks (/vercel/path0/node_modules/esbuild/lib/main.js:1069:65)
    at buildResponseToResult (/vercel/path0/node_modules/esbuild/lib/main.js:1149:7)
    at /vercel/path0/node_modules/esbuild/lib/main.js:1258:14
    at /vercel/path0/node_modules/esbuild/lib/main.js:629:9
    at handleIncomingPacket (/vercel/path0/node_modules/esbuild/lib/main.js:726:9)
    at Socket.readFromStdout (/vercel/path0/node_modules/esbuild/lib/main.js:596:7)
    at Socket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:293:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics
    Memory: 6.90 GB / 15.30 GB
  Binaries:
    Node: 14.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
    npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.43)
    Internet Explorer: 11.0.19041.1202

Severity

blocking an upgrade

Additional Information

No response

@onderbakirtas
Copy link
Author

onderbakirtas commented Dec 10, 2021

I've created a repo that uses Svelte (not Svelte Kit) and it seems there are no issues there. It deploys fine.

Here is the repo link: https://github.com/onderbakirtas/swiper-test

I can move this issue to the correct repo if this is not an issue with SvelteKit itself.

@onderbakirtas onderbakirtas changed the title SvelteKit Vercel deployment issue w/ Swiper SvelteKit deployment issue w/ Swiper Dec 10, 2021
@onderbakirtas
Copy link
Author

Here is the error in the bash when being deployed to CloudFlare.

> Using @sveltejs/adapter-cloudflare
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".css" for /opt/buildhome/repo/node_modules/swiper/swiper.min.css
    at new NodeError (node:internal/errors:371:5)
    at Object.file: (node:internal/modules/esm/get_format:72:15)
    at defaultGetFormat (node:internal/modules/esm/get_format:85:38)
    at defaultLoad (node:internal/modules/esm/load:13:42)
    at ESMLoader.load (node:internal/modules/esm/loader:303:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:58)
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:244:11)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:78:21)
    at async Promise.all (index 2)
> 500 /hi
Error: 500 /hi
    at file:///opt/buildhome/repo/node_modules/@sveltejs/kit/dist/chunks/index4.js:86:11
    at visit (file:///opt/buildhome/repo/node_modules/@sveltejs/kit/dist/chunks/index4.js:222:5)
    at async prerender (file:///opt/buildhome/repo/node_modules/@sveltejs/kit/dist/chunks/index4.js:303:6)
    at async Object.prerender (file:///opt/buildhome/repo/node_modules/@sveltejs/kit/dist/chunks/index4.js:368:4)
    at async adapt (file:///opt/buildhome/repo/node_modules/@sveltejs/adapter-cloudflare/index.js:27:4)
    at async adapt (file:///opt/buildhome/repo/node_modules/@sveltejs/kit/dist/chunks/index4.js:393:2)
    at async file:///opt/buildhome/repo/node_modules/@sveltejs/kit/dist/cli.js:896:5
Failed: build command exited with code: 1

@benmccann
Copy link
Member

I think this is an issue in the library: nolimits4web/swiper#5288 (comment)

I sent a fix to the libraries. I'll close this issue since it's not clear there's anything else to do here

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

2 participants