-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Segmentation fault when trying to run SvelteKit dev with 0.16.0-beta since 0.16.0-beta.9 #167
Comments
Hi, maintainer of vite-plugin-svelte here, the "require" error is actually happening because the import that was tried before that failed too (logging of vite-plugin-svelte could be better here, noted!). Note the section at the end with "Invalid host defined options" here's the full output of dev command in sveltekit (pnpm6, linux)
what confuses me is that this happens with sveltekit, but not with a vanilla vite-plugin-svelte setup.
With this the devserver works sveltekit uses here's how vite-plugin-svelte uses dynamic imports in a function to prevent typescript from turning it into a require: https://github.com/sveltejs/vite-plugin-svelte/blob/93ca647767c683d9f8996e670ae5c1b8171adc21/packages/vite-plugin-svelte/src/utils/loadSvelteConfig.ts#L12 for now this seems to only affect sveltekit + vite-plugin-windicss > 0.16.0-beta.9. Unfortunately i have no clue why. I hope the information provided is still useful. |
any solution to the problem? |
Any workarounds, it is impossible to use windicss with sveltekit due to this. |
@TheComputerM downgrade to 0.15.10 for now. there is a pr open to fix this, once it is merged it should work. see sveltejs/vite-plugin-svelte#54 |
issue can be closed due to sveltejs/vite-plugin-svelte#54 being merged |
Can anyone verify if it works? Thanks |
the error is gone but you still have to use WindiCSS.default() 😕 svelte.config.js import preprocess from 'svelte-preprocess';
import WindiCSS from 'vite-plugin-windicss'
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
vite: {
plugins: [WindiCSS.default()]
}
}
};
export default config; |
Thank you very much! Everything works now with latest versions! Closing issue. |
Describe the bug
When i try to run
npm run dev
in latest SvelteKit, i get an error[1] 2604 segmentation fault npm run dev
.Tried to revert version on vite-plugin-windicss step by step and found that 0.16.0-beta.9 and earlier versions are working normally.
Minimal Reproductions
npm init svelte@next
commandvite-plugin-windicss
withnpm i -D vite-plugin-windicss
npm run dev
causessegmentation fault
errornpm run build
causesVersions
Additonal Context
After some investigation, i found that it have started after devs of SvelteKit switched to ESM format of
svelte.config.js
in 1.0.0-next.97 version. With CommonJS version of
svelte.config.cjs
vite-plugin-windicss
works normally but seems that they will remove ability to use CJS version of config soon.The text was updated successfully, but these errors were encountered: