question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow Vite dev server mode to be set to a value other than development

See original GitHub issue

Description

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:closed
  • Created 10 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
brilloutcommented, Nov 22, 2022

Yea I saw that as well. I’ve a fix in mind. ETA today.

0reactions
brilloutcommented, Nov 24, 2022

Released in 0.4.52.

In case your company is up for it: https://github.com/sponsors/brillout.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found