Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ATA: Unable to resolve sub module path for dual published ESM/CJS package

Đang mở
#3,008 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đá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
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
node.js, typescript

Hướng nghiên cứu

Bắt đầu với bản tái hiện TypeScript Playground được liên kết và xác nhận rằng @sinclair/typebox được phân giải, còn @sinclair/typebox/value thì không. So sánh cấu hình package được mô tả trong báo cáo arethetypeswrong với ví dụ package-json-redirects, và coi issue là hoàn tất khi các import subpath ESM/CJS kép hợp lệ được phân giải trong Playground.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Page URL:

TypeScript Link Here

Example Code:

Code above

import { Type } from '@sinclair/typebox'        // ok
import { Value } from '@sinclair/typebox/value' // not found

Issue:

I'm not sure if this is a critical issue, but following a recent update to support dual published ESM / CJS in TypeBox. I have noticed that the TSP is no longer able to locate the /value sub module (or any other sub module), however the top level module import continues to work fine. I have checked to ensure TS resolution of sub module paths are valid for the package via the link below, I believe everything is setup correctly.

https://arethetypeswrong.github.io/?p=%40sinclair%2Ftypebox%400.32.4

I should note that this package uses a somewhat non-typical package redirection setup to support dual publishing. The technique it uses is described at the following link / project.

https://github.com/andrewbranch/example-subpath-exports-ts-compat/tree/main/examples/node_modules/package-json-redirects

Would be amazing if this could be looked at as I use the TSP almost daily to help users who have submitting issues to the TypeBox project. It would be a shame to lose the sub module imports as many type inference features exists for these sub modules, and it would be difficult to demonstrate functionality and share code via other means.

Many Thanks

Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
1.5k
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/TypeScript-Website

Tất cả issue của microsoft/TypeScript-Website

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.