Bug - react-icons 6.6.1- invalid ESM module
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 64/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript, webpack
- Ambito
- build-system, frontend
Direzione di ricerca
Inizia con la riproduzione minima all’indirizzo https://github.com/rszwajko/pf-icons-esm-bug e ispeziona l’import generato di react/jsx-runtime in @patternfly/react-icons/dist/esm/createIcon.js con Webpack. Riproduci il problema con React 17 e react-icons 6.6.1; il lavoro è completato quando la build di Webpack funziona senza allentare le regole di importazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 https://github.com/openshift/networking-console-plugin/commit/e4ed48dabced60f949d4af09559996b131c93fba
{
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
Jira Issue: PF-4648
- Lingua principale
- TypeScript
- Stelle
- 862
- Fork
- 392
- Merge medio
- 4g 8h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di patternfly/patternfly-react
-
PF Team
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
patternfly/patternfly-react#12651 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
patternfly/patternfly-react#12637 ·
-
PF Team
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
patternfly/patternfly-react#12617 · 1 commento ·
-
PF Team
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
patternfly/patternfly-react#12610 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
patternfly/patternfly-react#12600 ·
Tutte le issue di patternfly/patternfly-react
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
0xMiden/bridge-portal#132 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
area:tools bug good first issue help wanted priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
newrelic-experimental/preflight#793 · 1 commento ·