`new URL('./source.js', import.meta.url)` produces a URL ending in `[object%20Module]` with a `javascript/auto` rule
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #23312 của @thisisvaishnav — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- build-system
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 66k
- Fork
- 9.7k
- Merge trung bình
- 8 giờ 12 phút
- Pull request đã merge (30 ngày)
- 541
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của webpack/webpack
-
Fuzz: css syntax bug foundĐang mởarea: css
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Fuzz: html syntax bug foundĐang mởarea: html
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CSS Modules local ident hash includes `resourceQuery` (unlike `css-loader`), causing mismatched class names for query-based imports such as `?inline`Có thể đã có người làm @alexander-akait đã nhận hôm nay. Đang mởarea: css needs: reproduction regression
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
webpack/webpack#23696 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ESM output bakes hashed chunk filenames into importing modules, defeating long-term caching (no opt-out)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea: config area: runtime needs: reproduction regression
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
webpack/webpack#22056 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CSS: @value replacement in keyframes/animation produces broken outputCó thể đã có người làm @Yahiro025 đã nhận 81 ngày trước. Đang mởarea: css
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
webpack/webpack#22030 · 12 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của webpack/webpack
Issue tương tự
-
[bug] 提瓦特记事本原石检测框宽度较窄Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
babalae/bettergi-scripts-list#3905 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
dedicatedcode/reitti#1445 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New tool: Uncle DeskCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mởsubmission triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
kausalflow/tools#384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add spaced repetition schedulingĐang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
vercel/ai#25685 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày