Search code examples
reactjscreate-react-apphot-reload

process is not defined on hot reload


I have a react app made with create react app, and hot reloading kills the page entirely with the error:

Uncaught ReferenceError: process is not defined

What's strange is that there seems to be an iframe injected which I never noticed before:

enter image description here

This iframe is added to the DOM as soon as I reload and breaks the page as well as preventing an update. I can't find any documentation on "iframe-bundle.js" online.

Edit: I tried deleting my node modules and any questionable imports (I temporarily installed craco prior). Still the same issue. It's incredibly annoying!

Edit 2: If I delete that iframe everything seems to return to normal, i.e. page updates and is interactable


Solution

  • I fixed it. I did 2 things:

    • Updated npm to latest
    • Updated react-scripts to latest

    Not sure which one fixed it.