`new URL('./source.js', import.meta.url)` produces a URL ending in `[object%20Module]` with a `javascript/auto` rule
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #23312 di @thisisvaishnav — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- build-system
Direzione di ricerca
Start with the reproduction repository and run pnpm run webpack and pnpm run webpack:baseline, then compare dist/webpack/with-rule/ against dist/webpack/baseline/. The bug is that with a javascript/auto rule for .js, new URL('./source.js', import.meta.url) resolves to [object Module] and webpack does not emit source.js. Done means the with-rule bundle emits source.js and prints the same URL as the baseline.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Have you used AI?
Yes
Which part of webpack is affected?
not sure, config (options, defaults, validation)
Bug Description
new URL('./source.js', import.meta.url) to get a link to the original JavaScript file. When a rule sets type: 'javascript/auto' for all .js files, webpack compiles successfully, skips emitting the source file, and generates a URL ending in [object%20Module].
Link to Minimal Reproduction and steps to reproduce
The reproduction repository includes the emitted files. Clone it and run pnpm install --frozen-lockfile, then pnpm run webpack and pnpm run webpack:baseline.
Expected Behavior
The URL should point to the emitted copy of source.js, as it does in the baseline.
Actual Behavior
With the rule, webpack emits only dist/webpack/with-rule/bundle.cjs. Running it prints file:///…/dist/webpack/with-rule/[object%20Module].
Without the rule, webpack also emits dist/webpack/baseline/source.js. The bundle prints file:///…/dist/webpack/baseline/source.js, and cmp confirms that the emitted file matches the original byte for byte.
Environment
System:
OS: macOS 27.2
CPU: (18) arm64 Apple M5 Pro
Memory: 48.00 GB
Binaries:
Node: 24.15.0
Yarn: 1.22.22
npm: 11.12.1
pnpm: 10.34.4
Packages:
webpack: 5.112.2
webpack-cli: 7.3.1
Is this a regression?
None
Last Working Version
No response
Additional Context
No response
- Lingua principale
- JavaScript
- Stelle
- 66k
- Fork
- 9.7k
- Merge medio
- 8h 12m
- PR unite (30g)
- 541
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 webpack/webpack
-
Fuzz: css syntax bug foundApertaarea: css
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Fuzz: html syntax bug foundApertaarea: html
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
CSS Modules local ident hash includes `resourceQuery` (unlike `css-loader`), causing mismatched class names for query-based imports such as `?inline`Forse già presa @alexander-akait l’ha presa oggi. Apertaarea: css needs: reproduction regression
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
webpack/webpack#23696 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ESM output bakes hashed chunk filenames into importing modules, defeating long-term caching (no opt-out)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea: config area: runtime needs: reproduction regression
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
webpack/webpack#22056 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
CSS: @value replacement in keyframes/animation produces broken outputForse già presa @Yahiro025 l’ha presa 81 giorni fa. Apertaarea: css
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
webpack/webpack#22030 · 12 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di webpack/webpack
Issue simili
-
[bug] 提瓦特记事本原石检测框宽度较窄Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
babalae/bettergi-scripts-list#3905 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
dedicatedcode/reitti#1445 ·
I maintainer di solito rispondono entro 1 giorno
-
New tool: Uncle DeskForse già presa @github-actions l’ha presa oggi. Apertasubmission triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
kausalflow/tools#384 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
vercel/ai#25685 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno