Build fails after upgrading to vite > 2.9.0
See original GitHub issueDescribe the bug
It’s expect to build the project when, in a dependency, I export a svelte component, and then import that component. However the build fails with this error:
500
Unknown file extension ".svelte" for /home/projects/vitejs-vite-14hxgx/node_modules/@higenku/theme/src/footer/Footer.svelte
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".svelte" for /home/projects/vitejs-vite-14hxgx/node_modules/@higenku/theme/src/footer/Footer.svelte
at get (https://vitejs-vite-14hxgx.w-corp.staticblitz.com/blitz.9dc2007b053e3e7ca4daf0ec1a74b5c3910935fe.js:6:292488)
at instantiateModule (file:///home/projects/vitejs-vite-14hxgx/node_modules/vite/dist/node/chunks/dep-1513d487.js:50382:13)
at <anonymous> (<anonymous>)
You can check it yourself here
this should have fixed the problem, however It hasn’t
Reproduction
Open https://stackblitz.com/edit/sveltekiterror and see the error yourself
- install the next version of my theme
@higenku/theme@0.6.6-next
other versions work because you have to import the components yourself. - Import a component (I only exported the footer ones to test the vite 3 update)
<script lang="ts">
import {Footer} from "@higenku/theme"
</script>
Logs
Unknown file extension ".svelte" for /home/projects/sveltekiterror/node_modules/@higenku/theme/src/footer/Footer.svelte
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".svelte" for /home/projects/sveltekiterror/node_modules/@higenku/theme/src/footer/Footer.svelte
at get (https://sveltekiterror.w-corp.staticblitz.com/blitz.9dc2007b053e3e7ca4daf0ec1a74b5c3910935fe.js:6:292488)
at instantiateModule (file:///home/projects/sveltekiterror/node_modules/vite/dist/node/chunks/dep-1513d487.js:50382:13)
System Info
System:
OS: Linux 5.15 undefined
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 6.41 GB / 15.36 GB
Container: Yes
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.4.0 - /usr/local/bin/node
npm: 8.12.1 - /usr/local/bin/npm
Browsers:
Chromium: 103.0.5060.114
Firefox: 102.0.1
Severity
blocking an upgrade
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Troubleshooting - Vite
When the server / WebSocket server receives a large HTTP header, the request will be dropped and the following warning will be shown....
Read more >Yarn 3.1, Vite 2.9, cannot find package vite - Stack Overflow
1 Answer 1 · Unfortunately still doesn't work. It only starts working if I remove "type": "module" from package. · Update: Seems it...
Read more >vite - npm
A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production. In addition, Vite is ...
Read more >Vite (@vite_js) / Twitter
@vite_js. Fast and simple build tool for the web. ... APIs: prerendering, content collections, and clean error overlays Check out the changelogs.
Read more >[vite] internal server error: failed to resolve import - You.com
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t know how or why, but I started the project all over again and it worked
Ok, thx