Allow Vite dev server mode to be set to a value other than development
See original GitHub issueDescription
I was trying to set vite dev server mode like:
const viteDevServer = (
await vite.createServer({
mode: 'production',
root,
server: { middlewareMode: true },
})
)
Error Stack
Error: [vite-plugin-ssr@0.4.48][Bug] You stumbled upon a bug in vite-plugin-ssr's source code. Reach out at https://github.com/brillout/vite-plugin-ssr/issues/new or https://discord.com/invite/qTq92FQzKb and include this error stack (the error stack is usually enough to fix the problem). A maintainer will fix the bug (usually under 24 hours). Don't hesitate to reach out as it makes vite-plugin-ssr more robust.
at getRuntimeConfig (/PROJECT_DIR/node_modules/vite-plugin-ssr/dist/cjs/node/globalContext/runtimeConfig.js:17:24)
at getGlobalContext (/PROJECT_DIR/node_modules/vite-plugin-ssr/dist/cjs/node/globalContext.js:49:64)
at initializePageContext (/PROJECT_DIR/node_modules/vite-plugin-ssr/dist/cjs/node/renderPage.js:125:70)
at renderPage_ (/PROJECT_DIR/node_modules/vite-plugin-ssr/dist/cjs/node/renderPage.js:30:47)
at renderPage (/PROJECT_DIR/node_modules/vite-plugin-ssr/dist/cjs/node/renderPage.js:155:22)
at file:///PROJECT_DIR/server.js:125:31
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Server Options - Vite
Specify which IP addresses the server should listen on. Set this to 0.0.0.0 or true to listen on all addresses, including LAN and...
Read more >Configuring Vite
... is not using native Node ESM, e.g. type: "module" in package.json . ... determine options based on the command ( dev /...
Read more >Env Variables and Modes - Vite
By default, the dev server ( dev command) runs in development mode and the build command runs in production mode. This means when...
Read more >Configuring Vite
This value can also be overridden via the command line --mode option. ... But process or global should not be put into this...
Read more >Building for Production - Vite
When it is time to deploy your app for production, simply run the vite build command. By default, it uses <root>/index.html as the...
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 FreeTop 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
Top GitHub Comments
Yea I saw that as well. I’ve a fix in mind. ETA today.
Released in
0.4.52
.In case your company is up for it: https://github.com/sponsors/brillout.