Describe the problem
Webpack build fails with error:
ERROR in ./node_modules/@patternfly/react-icons/dist/esm/createIcon.js 2:0-63
Module not found: Error: Can't resolve 'react/jsx-runtime' in '/home/xxx/repos/pf_modules/node_modules/@patternfly/react-icons/dist/esm'
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
How do you reproduce the problem?
minimal code to recreate the issue: https://github.com/rszwajko/pf-icons-esm-bug
Initially encountered while updating libraries on older branches of https://github.com/openshift/networking-console-plugin
Expected behavior
Webpack build should work without relaxing import rules.
Is this issue blocking you?
No. Workaround exists i.e. as used here openshift/networking-console-plugin@e4ed48d
{
test: /\.m?js/,
include: /node_modules\/@patternfly\/.*/,
resolve: {
fullySpecified: false,
},
},
What is your environment?
React 17
react-icons 6.6.1
What is your product and what release date are you targeting?
https://github.com/openshift/networking-console-plugin
Describe the problem
Webpack build fails with error:
How do you reproduce the problem?
minimal code to recreate the issue: https://github.com/rszwajko/pf-icons-esm-bug
Initially encountered while updating libraries on older branches of https://github.com/openshift/networking-console-plugin
Expected behavior
Webpack build should work without relaxing import rules.
Is this issue blocking you?
No. Workaround exists i.e. as used here openshift/networking-console-plugin@e4ed48d
What is your environment?
React 17
react-icons 6.6.1
What is your product and what release date are you targeting?
https://github.com/openshift/networking-console-plugin