Log a warning when in development mode
See original GitHub issueDo you want to request a feature or report a bug?
- feature
Ref this tweet from Dan - https://twitter.com/dan_abramov/status/775647965197336576
It’s currently too easy to use React in development mode while in production, and there’s little warning from the library that this is happening. Further, it takes a fair bit of googling to know what to do, (it’s tucked away under ‘advanced performance’ in the docs, and doesn’t include directions for webpack/browserify).
As a start, I recommend that react always log a message to console when it’s in development mode. Something like -
“running in development mode, use production mode flags to speed up your code”
This stands out, and I hope will prevent some, if not most, of these misses.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:11 (8 by maintainers)
Top Results From Across the Web
"Inferno is in development mode." log in every Test Suit
Hi,. The You are running production build of Inferno in development mode. Use dev:module entry point. warning appears because the production ...
Read more >console.log only in development mode Angular 2
This approach is just add an extra layer of delaing with console object and you need to inject the logger service in every...
Read more >Development and production modes - Expo Documentation
Development mode includes useful warnings and gives you access to tools that make development and debugging easier. Production mode minifies your code and ......
Read more >Log messages in the Console - Chrome Developers
Each console.* method is assigned a severity level: Verbose , Info , Warning , or Error . For example, ...
Read more >Disable "You are running Vue in development mode" warning
Disable "You are running Vue in development mode" warning ... Hi,. I'm using Vue in a fresh install of Laravel. In the console...
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 Free
Top 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
Good point, I forgot about that one! It seems like some people don’t read logs in production then.
Logging a warning in development would serve to educate them about different development/production modes. We already have a warning about DevTools so maybe we could change its wording to also make it clear this is dev version of React itself, and always show it?
We now warn in DevTools and it’s been working well. We also have docs about it now.