Development mode is incorrect in vite dev
See original GitHub issueSummary
In a browser accessing a Vite dev server, the value of isDevelopment()
is false
.
Therefore /_vercel/insights/script.js
is requested, resulting in a 404 Not Found
.
Reason
In a browser accessing a Vite dev server, the process
is undefined
.
Therefore isDevelopment()
returns false
.
Reproduction
Open the browser console to see what is logged in the client inside StackBlitz.
Values
In a browser accessing a Vite dev server:
SvelteKit | Next.js | |
---|---|---|
isBrowser() | true | true |
isDevelopment() | false * | true |
typeof process | undefined * | object |
typeof process.env.NODE_ENV | string | string |
process.env.NODE_ENV | development | development |
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Development mode transpiles correctly while build doesn't.
This loads bip39 and works perfectly when running yarn dev(I did have to use some work arounds to get it running), when building...
Read more >Troubleshooting - Vite
Vite cannot handle and does not support code that only runs on non-strict mode (sloppy mode). This is because Vite uses ESM and...
Read more >Vue.js 3: run build vite with dev configuration for debugging
I modified the package.json definition for npm run build to change the associated command to "vite build --mode dev" but that didn't work...
Read more >Asset Bundling (Vite) - The PHP Framework For Web Artisans
There are two ways you can run Vite. You may run the development server via the dev command, which is useful while developing...
Read more >Configuring Vitest
Create vitest.config.ts , which will have the higher priority and will override the configuration from vite.config.ts; Pass --config ...
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
Awesome! Side note: we’re going to ship it as
mode
instead of__mode
.You can disable those log messages by providing the
debug
property withfalse
if your mode isdevelopment
.Please see our documentation around the
debug
propertyPerfect, thanks for confirmation.
Closing as it’s resolved with v0.1.6
Documentation is already updated