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
The 4.x series of releases cause build failures with Vite (and Vike) when using the "prerendering: true" option. The error DOES NOT occur using 3.9.5 but occurs on 4.0.0
The error is:
[vike][Warning] Vite's development server was instantiated while the environment is set to be a production environment by process.env.NODE_ENV === "production" which is contradictory, see https://vike.dev/NODE_ENV
dist/server/entry.mjs 5.13 kB
✓ built in 65ms
vike v0.4.171 pre-rendering HTML...
2:30:26 PM [vike][Warning] Vite's development server was instantiated while the environment is set to be a production environment by process.env.NODE_ENV === "production" which is contradictory, see https://vike.dev/NODE_ENVError: [[email protected]][Bug] You stumbled upon a Vike bug. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error. A maintainer will fix the bug (usually under 24 hours). at initGlobalContext (file:///private/tmp/vt/node_modules/vike/dist/esm/node/runtime/globalContext.js:90:9) at runPrerender (file:///private/tmp/vt/node_modules/vike/dist/esm/node/prerender/runPrerender.js:80:11) at runPrerenderFromAutoFullBuild (file:///private/tmp/vt/node_modules/vike/dist/esm/node/prerender/runPrerender.js:47:9) at triggerFullBuild (file:///private/tmp/vt/node_modules/vike/dist/esm/node/plugin/plugins/autoFullBuild.js:92:9) at Object.handler (file:///private/tmp/vt/node_modules/vike/dist/esm/node/plugin/plugins/autoFullBuild.js:31:25) at async Promise.all (index 0) at PluginDriver.hookParallel (file:///private/tmp/vt/node_modules/rollup/dist/es/shared/node-entry.js:19706:9) at file:///private/tmp/vt/node_modules/rollup/dist/es/shared/node-entry.js:20703:13
Validations
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
In general, 4.x seems very broken with vike.
If I use both vike-node and @vanilla-extract/vite-plugin and run pnpm build, the vite compiler enters an endless loop.
I think this happens, because @vanilla-extract/vite-plugin also calls the vite compiler internally and passes down the plugins from the user's vite config, and as such includes vike-node.
A potential fix for this might be to let the user decide with what (subset of) vite plugins vanilla-extract should run.
Describe the bug
The 4.x series of releases cause build failures with Vite (and Vike) when using the "prerendering: true" option. The error DOES NOT occur using
3.9.5
but occurs on4.0.0
The error is:
To replicate the error:
npm init vike@latest
npm install @vanilla-extract/vite-plugin
vite.config.ts
to add vanilla-extract:npm run build
Reproduction
https://github.com/nathanstitt/vanilla-extract-vite-ssg
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: