I am experiencing an error during the build process of my Gatsby, Contentful, and Shopify projects on Netlify. The error message is preventing the project from being built successfully. It is throwing an error with the message “Generating SSR bundle failed, can’t import the named export “isValidElementType” from non EcmaScript module (only default export is available”
I have tried updating react-is, @lodable using npm, but it did not work out, can you please advise on how to address this issue?
@DigitUp Hi, I am experiencing the same error during the build process of my Gatsby project in Netlify. I found the reason for the issue. Problem was in @loadable/component dependency. What I did to solve this issue was: I removed @loadable/component dependency and replace it with react-imported-component dependency. I also removed gatsby-plugin-loadable-components-ssr.
In my code, I replaced:
import loadable from ‘@loadable/component’
const Menu = loadable(() => import(‘./menu/Menu’));
with:
import importedComponent from ‘react-imported-component’;
const Menu = importedComponent(() => import(‘./menu/Menu’));