react-hot-loader: Version 4.8.5 introduces a new console error on every file unit tested with jest
Description
Whereas before, my unit test suite would pass without errors or warnings, simply by upgrading my version from 4.8.4 to 4.8.5, I get the following console error on every file:

Expected behavior
No error as with version 4.8.4, since I haven’t touched any files, other thank package.json.
Actual behavior

Environment
React Hot Loader version: 4.8.5
Run these commands in the project folder and fill in their results:
node -v: 11.1.0npm -v: 6.9.0
Then, specify:
- Operating system: Osx
- Browser and version: Chrome, 74
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 6
- Comments: 31
Commits related to this issue
- fix: remove checks. fixes #1252 — committed to gaearon/react-hot-loader by theKashey 5 years ago
- Merge pull request #1254 from gaearon/fix-hot-jest fix: remove checks. fixes #1252 — committed to gaearon/react-hot-loader by theKashey 5 years ago
Try v4.8.8. Sorry @tommarien - saw you message too late 😄
For jest I think node_env is test while running, could we add it to the disabled state. Seems like a common approach what do you think ? On 23 May 2019, 08:15 +0200, Anton Korzunov notifications@github.com, wrote:
I have a load of tests whereby I need to explicitly set
process.env.NODE_ENVto something other than “test” - for example testing routes that are only added to development builds, etc.It would be nice to have a workaround for this - for now, I will need to pin to 4.8.4…
So it always was just a
console.errorand I’ve fixedthrow new Errorinhot, which does a bit different thing.Let me think about a proper way to fix this, but for now the best way to address this issue is to remove babel plugin in jest environment. It’s adding RHL registration code to the every file, but you don’t need it for tests.