Error being thrown by gatsby-plugin-netlify-cms

My site builds and works in development mode, but when deployed, this error is thrown and the build fails:

3:53:55 PM: error “gatsby-plugin-netlify-cms” threw an error while running the onCreateWebpackConfig lifecycle:
3:53:55 PM: Package subpath ‘./umd/react.production.min.js’ is not defined
3:53:55 PM: 212 | assetDir = _ref6.assetDir;
3:53:55 PM: 213 | return [{
3:53:55 PM: > 214 | from: require.resolve(_path.default.join(name, assetDir, assetName)),
3:53:55 PM: | ^
3:53:55 PM: 215 | to: assetName
3:53:55 PM: 216 | }, sourceMap && {
3:53:55 PM: 217 | from: require.resolve(_path.default.join(name, assetDir, sourceMap)),
3:53:55 PM: Make sure that you don’t have a typo somewhere and use valid arguments in onCreateWebpackConfig lifecycle.
Learn more about onCreateWebpackConfig here: https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#onCreateWebpackConfig

I’m clueless as to where the error lies. Any ideas?

Did you upgrade your app to use React v18 recently?

I updated to v18 and encountered the same error, went back to v17 and the error went away.

Wait so does that mean that Netlify CMS doesn’t support React 18 yet? (Can someone at Netlify confirm this?)

Hey @mosesoak,

I believe the best way to confirm that is by opening an issue on Netlify CMS repo. The Support Team doesn’t actively provide full-fledged support for Netlify CMS, so we cannot confirm this.

Someone did open an issue there (React 18 support · Issue #6499 · netlify/netlify-cms · GitHub) which was posted nearly 2 months ago and it hasn’t gotten any response from their team yet.

Good news though, after doing a full round of upgrades to our project, we’re able to build with React 18. I left a comment there about it.