ESM re-exports from CJS module not included in exports
Đang mở
Chưa có ai nhận issue này.
loaders
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.3k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 283
Mô tả
Version
node-v
Platform
Microsoft Windows NT 10.0.26100.0 x64
Subsystem
No response
What steps will reproduce the bug?
// main.mjs
import * as mod from "./mod.js";
console.log(mod);
// mod.js
module.exports = {
...require("./other.js")
};
// other.js
export function test() {}
> node main.mjs
[Module: null prototype] {
default: { test: [Function: test] },
'module.exports': { test: [Function: test] }
}
> deno -A --unstable-detect-cjs main.mjs
[Module: null prototype] {
default: { test: [Function: test] },
"module.exports": { test: [Function: test] },
test: [Function: test]
}
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior? Why is that the expected behavior?
It should detect the "test" export from the ES module.
What do you see instead?
It's missing.
Additional information
No response
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.
Hướng nghiên cứu
Tái hiện vấn đề với main.mjs, mod.js và other.js bằng node main.mjs, sau đó so sánh đầu ra namespace của Node với ví dụ Deno. Theo dõi việc Node phát hiện export CommonJS-to-ESM và xác minh rằng export kiểm thử từ other.js được bao gồm trong namespace.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- backend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 48/100