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
This kind of output in the browser console is really hard to work with. Can I disable these outputs?
[HMR] App is up to date.
[WDS] App updated. Recompiling...
[WDS] App hot update...
[HMR] Checking for updates on the server...
Reacted by aaron, Haroen Viaene, Yami Odymel, Hossein Saniei, András Geiszl, haydenhw, NathanParsonKoroso, Daniel Lizik, bArraxas, Иван Вольнов and 5 more
You can copy paste webpack/hot/only-dev-server to your project, strip logs from it and use your version instead.
Closing, let me know if I missed something!
Reacted by Fernando Montoya and Matthieu
Reacted by Constantine, NathanParsonKoroso, Alex, Ray, Eric Ogden, Matúš Koprda, Gabriel Francisco, Brock Dusome, Giorgio Acosta, rhgb and 20 more
Reacted by Danakt Saushkin, Adonis Kakoulidis, Dragan Filipović, Chris Domigan, Jamie Maple, Dmitrii Vasilev, Alex, Yami Odymel, Jan Potoms, Anton Pegov and 13 more
Reacted by Иван Вольнов, Christopher Brown, Andrii Mykhailov, Matt Zygmunt, Adrian Moisa, Philippe Leefsma, Kirk Strobeck, Mark Murray, Josh, Robert Martin and 24 more
I'd use if ('production' !== process.env.NODE_ENV) in this case.
You'd need to set it to true using DefinePlugin for production anyway so React is properly compressed.
@leongaban They're sprinkled liberally througout the code.
Go to your /node_modules/webpack folder and run a search and replace:
find . -type f -name "*.js" -exec sed -i '' 's/console.log.*$//g' {} \;
Reacted by Leon Gaban, Ali Torki, Fernando Montoya and Francis Bourassa
Reacted by Raitis Stengrevics, Ali Torki, Tomasz Nowakowski, Cliff Odijk, Nikita Saltykov, slavic18, Yami Odymel, Fernando Bueno, MrHen, Shirsh Zibbu and 8 more
Reacted by Ali Torki, Iliyan Iliev, Fernando Bueno, Giampaolo Bellavite, Martin Bielik, Iago Alves, Hamza Mihai Daniel and Jakub Švehla
Reacted by Ali Torki, Adonis Kakoulidis, Nikita Saltykov, Anton Pegov and Hamza Mihai Daniel
A quick way to silencing could be filtering in devtools with regex. i.e. ~ /^((?!(\[HMR|\[WDS)).)*$/
UPDATE: in chrome 62 we can simply use -HMR -WDS
Reacted by Fernando Montoya, Iliyan Iliev, Enzo Muhlinghaus, olavk, Jessie Gonzalez, gpurgal, Harshith Kashyap, Yami Odymel, 7twin, Javier Pacareu and 29 more
Reacted by Piotr Piech, William A, Robbert van Caem, Arseniy-II, Arbaoui Mehdi, NathanParsonKoroso, Kyle Tycholiz, Kyle Wiedman, Simon Brandt, Nick Verges and 3 more
Reacted by Andrew, Daniel Lizik, Adrian Moisa and Darko Maksimovic
Reacted by Simon Brandt, ɛʟʟɨօȶ b =^._.^= ∫ and charle
Reacted by Alexander Schwarzman, juanmartinzzz, Eric Ogden, Adrian Moisa, Epskampie, Neil, Gancho Stoychev, Russell, Cr4xy, Jonathan Bristow and 5 more
Reacted by Jonathan Bristow and nd.khuong
Reacted by Jonathan Bristow
Reacted by Eric Ogden, Gancho Stoychev, Russell, scriptchao and Jonathan Bristow
Reacted by Allen Mackley, Hubert, Иван Вольнов, Evgenii Voinov, Shkumbin Maksuti, Соснин Алексей, Ismail, Roman Tsvetkov, ɛʟʟɨօȶ b =^._.^= ∫, Travis Vander Hoop and 2 more
Activity
gaearon commentedon Feb 14, 2015
You can copy paste
webpack/hot/only-dev-serverto your project, strip logs from it and use your version instead.Closing, let me know if I missed something!
steida commentedon Feb 14, 2015
Silent option in configuration would be nice.
gaearon commentedon Feb 14, 2015
It's not really something we can control in RHL. You can file an issue with Webpack.
pburtchaell commentedon Feb 15, 2015
It's a bit hacky, but I currently have this and it helps by clearing the console of old logs after each refresh:
The
WEB_ENVvariable is set by WebPack in the config.gaearon commentedon Feb 15, 2015
I'd use
if ('production' !== process.env.NODE_ENV)in this case.You'd need to set it to
trueusingDefinePluginfor production anyway so React is properly compressed.roman-orlovskiy commentedon Dec 1, 2016
How disable console.log for webpack/hot/only-dev-server ??
const server = new WebpackDevServer(compiler, { stats: {colors: true}, hot: true, clientLogLevel: 'none', //quiet: true, watchOptions: { ignored: /node_modules/ } /* historyApiFallback: { index: '/' }*/ });quiet: true not working!
tavurth commentedon Apr 22, 2017
Add this to your apps
index.js:For example, this is part of my index.jsx entry point:
if (module.hot)will get culled out when we run production minification, and every time HMR reloads, we'll clear the console.leongaban commentedon May 10, 2017
This is really annoying, could anyone tell me where these logs are located in the
react-hot-reloadfolder? Did not see them.tavurth commentedon May 11, 2017
@leongaban They're sprinkled liberally througout the code.
Go to your
/node_modules/webpackfolder and run a search and replace:leongaban commentedon May 11, 2017
@tavurth ah thanks! I was looking in the react-hot-reload folder.
tavurth commentedon May 11, 2017
There's also this:
webpack/webpack-dev-server#579 (comment)
peteobrien commentedon Oct 30, 2017
A quick way to silencing could be filtering in devtools with regex. i.e. ~
/^((?!(\[HMR|\[WDS)).)*$/UPDATE: in chrome 62 we can simply use
-HMR -WDStofilagman commentedon Apr 12, 2018
Add this to your apps index.js or index.ts:
lorenzomigliorero commentedon May 8, 2018
Import
logmodule directly in your bundle, and change logLevel:geiszla commentedon Oct 18, 2018
For those who can't make it work with
import { setLogLevel } from 'webpack/hot/log', see this comment: webpack/webpack#6265 (comment)IAMtheIAM commentedon Nov 29, 2018
Hey guys, none of these suggestions worked for me, except the CLI option does!!
It defaults to
infowhich is where all the [HMR] and [WDS] spam comes from.jwld commentedon Mar 21, 2019
You can also just set
clientLogLevelin your webpackdevServerconfig:https://webpack.js.org/configuration/dev-server/#devserverclientloglevel
fenok commentedon May 22, 2019
If you're using
webpack-hot-middleware, you can configure it like this:webpack-hot-middleware/client?reload=true&noInfo=trueagrublev commentedon Jul 28, 2019
Webpack config
elliotberry commentedon Jan 20, 2021
I love you guys. Finally found this thread after raging hard for like two years
peterbartos commentedon Jun 1, 2022
In the current version the config is:
https://webpack.js.org/configuration/dev-server/#logging