The "path" argument must be of type string or an instance of URL. Received undefined
See original GitHub issueDescribe the bug
I create Nuxt project and got this error when build project. Minimal Reproductions
npm init nuxt-app demo_project -> UI framework: Windi Css -> Render mode: Universal -> Deploy target: Server npm install npm run build Versions
- vite-plugin-windicss: 1.8.9
- vite:4.0.1
- framework(vue/react/svelte/etc): nuxtjs
Additonal Context console log ` npm run build
testnuxt@1.0.0 build nuxt build
FATAL The “path” argument must be of type string or an instance of URL. Received undefined 11:18:17
at new NodeError (node:internal/errors:372:5) at fileURLToPath (node:internal/url:1420:11) at node_modules/vite-plugin-windicss/dist/index.mjs:119:71 at ModuleJob.run (node:internal/modules/esm/module_job:198:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:385:24) at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15) at async ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:239:20) at async ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:51:7) at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:478:5)
│ │ │ ✖ Nuxt Fatal Error │ │ │ │ TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string or an instance of URL. Received undefined ]
Issue Analytics
- State:
- Created 9 months ago
- Reactions:1
- Comments:7
You can temporarily use vite-plugin-windicss@1.8.8,Because from version 1.8.9 of vite-plugin-windicss, the dependent version of tsup has been upgraded, and tsup@6.5.0 will follow the configuration in tsconfig.json, and the target in tsconfig.json in vite-plugin-windicss The option is set to es2017, this version will cause an error in import.meta after build
You can see https://github.com/windicss/vite-plugin-windicss/pull/314
also, if you use yarn, maybe you need this:
"resolutions": { "vite-plugin-windicss": "1.8.8" }, "overrides": { "nuxt-windicss": { "vite-plugin-windicss": "1.8.8" } }