Error with SvelteKit
See original GitHub issueDescribe the bug
On Windows:
- Did
pnpm init svelte@next - Followed the steps in this repo with
import "virtual:windi.css"insidesrc/$layout.svelte pnpm run devgives the error
Minimal Reproductions
Versions
- vite-plugin-windicss: 0.8.3
- vite: 2.1.0
- framework(vue/react/svelte/etc): sveltejs/kit 1.0.0-next.49
Additonal Context
On pnpm run dev:
> Executing task: pnpm run dev <
> windinew@0.0.1 dev C:\Users\HP\Desktop\windinew
> svelte-kit dev
failed to load config from C:\Users\HP\Desktop\windinew\vite.config.js
> WindiCSS is not a function
TypeError: WindiCSS is not a function
at file:///C:/Users/HP/Desktop/windinew/vite.config.js?t=1615900612482:14:3
at ModuleJob.run (node:internal/modules/esm/module_job:154:23)
at async Loader.import (node:internal/modules/esm/loader:166:24)
at async loadConfigFromFile (C:\Users\HP\Desktop\windinew\node_modules\.pnpm\vite@2.1.0\node_modules\vite\dist\node\chunks\dep-6f1d3d8c.js:46129:31)
at async resolveConfig (C:\Users\HP\Desktop\windinew\node_modules\.pnpm\vite@2.1.0\node_modules\vite\dist\node\chunks\dep-6f1d3d8c.js:45783:28)
at async Object.createServer (C:\Users\HP\Desktop\windinew\node_modules\.pnpm\vite@2.1.0\node_modules\vite\dist\node\chunks\dep-6f1d3d8c.js:68984:20)
at async Watcher.init_server (file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/chunks/index.js:3225:24)
at async Watcher.init (file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/chunks/index.js:3195:3)
at async file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/cli.js:474:20
file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/chunks/index.js:3488
this.viteDevServer.close();
^
TypeError: Cannot read property 'close' of undefined
at Watcher.close (file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/chunks/index.js:3488:22)
at process.<anonymous> (file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/chunks/index.js:3185:9)
at process.emit (node:events:379:20)
at process.EventEmitter.emit (node:domain:470:12)
at process.exit (node:internal/process/per_thread:178:15)
at handle_error (file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/cli.js:451:10)
at file:///C:/Users/HP/Desktop/windinew/node_modules/.pnpm/@sveltejs/kit@1.0.0-next.49_d563d1e4217ff8882402c11be2b46d5a/node_modules/@sveltejs/kit/dist/cli.js:487:4
ERROR Command failed with exit code 1.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Errors • Docs • SvelteKit
Errors are an inevitable fact of software development. SvelteKit handles errors differently depending on where they occur, what kind of errors they are, ......
Read more >replace `%sveltekit.message%` with `%sveltekit.error ... - GitHub
It would make sense if we respected the App.PageError shape in src/error.html . Describe the proposed solution. Change %sveltekit.message% to % ...
Read more >I am facing error while runing sveltekit app (Not found:/)
Pages have been renamed from index.svelte to +page.svelte . When you rename your routes they should be detected without a custom entry file...
Read more >Using `throw error` on a server endpoint. How to get it ... - Reddit
On a server-side only endpoint, I use `throw error`, error being the export from sveltekit. How do I pass that to the `+error.svelte`...
Read more >Error loading module in Sveltekit - Netlify Support Forums
Hello there, I'm working on a SvelteKit website and deploying it to Netlify. I'm having some issues with a particular error.
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

@NoelJacob This worked for me without removing
type: "module":I’ve also ran into this with
"type": "module"(I load my vite config on the server and one of my server deps is esm-only so I have to use"type": "module"on both the client and the server).A fix that seems to work perfectly is going into the plugin’s
package.jsonand adding this:Which seems odd and redundant but hey, my editor doesn’t complain anymore and it seems to work fine in the vite dev server. So is there a possibility of this fix getting added? Is there any drawback to adding it? Should I open a PR?