devloco / create-react-wptheme

Create modern, React-enabled WordPress themes with a single command.
MIT License
359 stars 60 forks source link

Error Overlay Not Behaving The Same as Create React App's Overlay #35

Open devloco opened 4 years ago

devloco commented 4 years ago

Sometimes the error overlay looks wonky if you manually refresh the browser. For example in App.tsx (note TypeScript) if you change line 3 to this (note the foo):

import foo "./App.css";

The initial overlay looks as expected. But then hit F5 to manually refresh and it looks very different. Doing the same steps in a normal create-react-app project does not show the same behavior.

2020-01-01 21_27_23

Everything is still running properly, i.e. saving a file will still cause the browser to refresh. Even if the newly saved page has another error, it causes the error overlay to re-render properly. So this is really just a cosmetic bug.

devloco commented 4 years ago

Just thinking about this... If I recall, I'm storing Webpack's last build result in the wpstart.js file... but probably mangling it some how. So if you manually refresh the browser, you're getting the mangled version of the build result.

There's a chance that fixing #41 will also fix this... so be sure to fix that one first, then test this again.