You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, WXT uses c12 (and c12 uses jiti internally) to load the wxt.config.ts file, but it is loaded as CJS.
This causes Vite 5's CJS warning to show up when importing a Vite plugin, like Vue. At the bottom of the stacktrace, you can see the warning is triggered by @vitejs/plugin-vue in this case. Same with all other vite plugins that import vite.
Trace: The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
at warnCjsUsage (/home/runner/work/wxt/wxt/templates/vue/node_modules/vite/index.cjs:32:3)
at Object.<anonymous> (/home/runner/work/wxt/wxt/templates/vue/node_modules/vite/index.cjs:3:1)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/home/runner/work/wxt/wxt/templates/vue/node_modules/@vitejs/plugin-vue/dist/index.cjs:6:14)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
The text was updated successfully, but these errors were encountered:
aklinker1
added
triage
Bug or problem that needs to be looked into
bug
Something isn't working
upstream
Issue related to an upstream library
and removed
triage
Bug or problem that needs to be looked into
labels
Dec 23, 2023
Describe the bug
Currently, WXT uses
c12
(andc12
usesjiti
internally) to load thewxt.config.ts
file, but it is loaded as CJS.This causes Vite 5's CJS warning to show up when importing a Vite plugin, like Vue. At the bottom of the stacktrace, you can see the warning is triggered by
@vitejs/plugin-vue
in this case. Same with all other vite plugins that import vite.To Reproduce
repro.zip
Note
Using v0.12.3 because the warning is silenced in later versions.
The warning is present in the prepare, build, and dev commands.
Expected behavior
The
wxt.config.ts
file should be imported as ESM, and these warnings should go away.Environment
Additional context
The text was updated successfully, but these errors were encountered: