microsoft / microsoft/TypeScript
Use explicit extensions in TypeScript's package.json for Node ES resolution compatibility
Đang mở
Chưa có ai nhận issue này.
In Discussion
Suggestion
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.4k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 117
Mô tả
Bug Report
🕗 Version & Regression Information
Versions:
- 4.3.2
- 4.1.2
- This is a crash
- This is the behavior in every version I tried
⏯ Playground Link
💻 Code
Run tsc (yarn tsc, yarn exec tsc, npx tsc, ./node_modules/.bin/tsc) with nodejs flag --experimental-specifier-resolution=node (NODE_OPTIONS="--experimental-specifier-resolution=node" tsc)
🙁 Actual behavior
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module "file:///path/to/project/node_modules/typescript/bin/tsc"
at Loader.getFormat (internal/modules/esm/loader.js:117:13)
at async Loader.getModuleJob (internal/modules/esm/loader.js:242:20)
at async Loader.import (internal/modules/esm/loader.js:176:17)
at async Object.loadESM (internal/process/esm_loader.js:68:5) {
code: 'ERR_INVALID_MODULE_SPECIFIER'
}
🙂 Expected behavior
Build without errors
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
Bắt đầu bằng cách kiểm tra package.json của TypeScript và entry point tsc được hiển thị trong node_modules/typescript/bin/tsc, sau đó tái hiện lỗi crash bằng flag --experimental-specifier-resolution=node của Node. Hoàn thành khi lệnh tsc build mà không gặp lỗi ERR_INVALID_MODULE_SPECIFIER đã được báo cáo trong ví dụ tối giản được cung cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- node.js, typescript
- Lĩnh vực
- build-system, cli
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100