node-resolve plugin discards this re-exported file
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- build-system, tooling
Direzione di ricerca
Start with the linked StackBlitz reproduction and inspect @rollup/plugin-node-resolve's handling of the re-exported util.inspect.js file. Compare the generated vendor and index chunks with the source snippets; done when the require is preserved and the ReferenceError no longer occurs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- Rollup Plugin Name:
@rollup/plugin-node-resolve - Rollup Plugin Version: 16.0.3
- Rollup Version: 4.52.0
- Operating System (or Browser): Linux
- Node Version: 20 +
- Link to reproduction (⚠️ read below): https://stackblitz.com/edit/vitejs-vite-os2s19kt?file=src%2FApp.tsx
Expected Behavior
The re-export of ./util.inspect.js by object-expect should not be discarded, causing a run time failure.
index.js contains these lines
var utilInspect = require('./util.inspect');
var inspectCustom = utilInspect.custom;
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
This require should be preserved, as './util.inspect' contains just this line:
module.exports = require('util').inspect;
Actual Behavior
The require statement is mangled at some point:
vendor chunk (Zt is equivalent to v in the index chunk):
var M = Zt // <--- error here
, B = M.custom
, re = J(B) ? B : null
index chunk
const p = {}
, h = Object.freeze(Object.defineProperty({
__proto__: null,
default: p
}, Symbol.toStringTag, {
value: "Module"
}))
, v = f(h)
so that this error is produced (see repro link above):
Uncaught ReferenceError: Cannot access 'Zt' before initialization
at _e (vendor-o4ka1zf0.js:9:5572)
at In (vendor-o4ka1zf0.js:12:15964)
at Fn (vendor-o4ka1zf0.js:12:19479)
at Tn (vendor-o4ka1zf0.js:12:30519)
at vendor-o4ka1zf0.js:12:30590
Additional Information
On my actual build (not the stack blitz) at what files are 'available' via source map, the whole 'util.inspect.js' file is missing
- Lingua principale
- JavaScript
- Stelle
- 3.8k
- Fork
- 636
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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 rollup/plugins
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Support js-yaml v5Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di rollup/plugins
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
aiko-chan-ai/DiscordBotClient#380 ·
-
Offisielle trærAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Daemon delete dialog: "Remove all ExApps" checkbox and `removeExApps` parameter have no effectAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 3 giorni
-
Add: Atlas TVApertachannels:add check:passed
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 4 giorni