Was getting this error (among a long list of other errors) after importing and using the ApolloProvider component:
ERROR in ./node_modules/graphql/index.mjs 64:0-70:117
Can't reexport the named export 'visitWithTypeInfo' from non EcmaScript module (only default export is available)
After some research, it seems to be an conflict with Webpack 4 and GraphQL (documented here: graphql/graphql-js#1272).
I was able to resolve the errors, successfully complete the workshop and add products to my shop by adding the following to the webpack.config.js file:
within the rules:
{
test: /.mjs$/,
include: /node_modules/,
type: "javascript/auto",
}
within the resolve:
extensions: ["*", ".webpack.js", ".web.js", ".mjs", ".js", ".jsx", ".json"]