Graphics Cove

Gatsby and React 17 - AppContainer should be patched

AppContainer should be patched is a common issue in React 17, here's how to fit it.

Steven NobleSteven Noble··1 min read
Share

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.

Share
Steven Noble

Written by

Steven Noble

Steven Noble is the founder of Graphics Cove, a senior full-stack engineer with 19 years building web products for startups and established companies. He writes about engineering, delivery and running a technical practice.

Related reading