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
When trying to get SSR working, the sample project will not build in production mode. I think the code which sets process.env.NODE_ENV is being replaced, so that variable can't be assigned?
$ /Users/jakeginnivan/_code/vite-ts-ssr/vite-project/node_modules/.bin/vite build --outDir dist/server --ssr src/entry-server.ts
vite v2.5.6 building SSR bundle for production...
✓ 62 modules transformed.
[commonjs] Assigning to rvalue (33444:4) in /Users/jakeginnivan/_code/vite-ts-ssr/vite-project/node_modules/vite/dist/node/chunks/dep-9f74b403.js
file: /Users/jakeginnivan/_code/vite-ts-ssr/vite-project/node_modules/vite/dist/node/chunks/dep-9f74b403.js:33444:4
33442:
33443: if (!ctx.env) {
33444: process.env.NODE_ENV = 'development';
^
33445: }
My naive guess is that what is actually happening is 'production' = 'development'?
It is possible this is another variation of #3229, but thought I would open a fresh issue because the symptoms are a bit different.
Describe the bug
When trying to get SSR working, the sample project will not build in production mode. I think the code which sets
process.env.NODE_ENV
is being replaced, so that variable can't be assigned?My naive guess is that what is actually happening is
'production' = 'development'
?It is possible this is another variation of #3229, but thought I would open a fresh issue because the symptoms are a bit different.
Reproduction
https://github.com/JakeGinnivan/vite-ssr-build-issue
Then run
yarn && yarn vite build --outDir dist/server --ssr src/entry-server.ts
.System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: