Gatsby and React 17 - AppContainer should be patched
If you have just updated to React 17, you might get the following error with Gatsby:
Error: React-Hot-Loader: AppContainer should be patched
The simple solution to fix this error is to run npm update
.
If npm update
doesn't change anything, delete your lockfile (yarn.lock
or package-lock.json
) and re-run your package manager.
Under the hood, this is related to how React now uses the new JSX transform. It is used in the latest version of Gatsby (Currently v2.24.5). hot-loader/react-dom(17.0.0-rc.2)
and react-hot-loader(4.13.0)
have been updated (Which were the original causes of this problem), so there should no longer be any issues going forward.