[BUG] SWC preset generates project with TypeScript 7 incompatible with @swc-node/register

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

@Romakita đang làm issue này rồi.

Từ ngày 7/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

blocker

Information

  • Version: @tsed/cli 7.8.0
  • Node.js: v24.18.0
  • npm: current npm bundled with Node.js 24
  • OS: Linux

Packages generated by the Ts.ED CLI include:

typescript@^7.0.2
@swc-node/register@^1.12.1

When creating a new project with the Node.js + SWC preset, the generated dependency set is not installable cleanly because @swc-node/[email protected] declares:

peer typescript >=4.3 <7

Example

After generating a fresh project, running:

npm install

fails with:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree

npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/typescript
npm error   typescript@"^7.0.2" from the root project

npm error Could not resolve dependency:
npm error peer typescript@">= 4.3 < 7" from @swc-node/[email protected]
npm error node_modules/@swc-node/register
npm error   @swc-node/register@"^1.12.1" from the root project

If the dependency conflict is bypassed and the application is started anyway, it fails at runtime:

TypeError: Cannot read properties of undefined (reading 'Js')
    at Object.<anonymous> (.../node_modules/@swc-node/register/transform-cache.ts:18:53)

This appears to be the same incompatibility already indicated by the peer dependency constraint.

Expected behavior

A freshly generated project using the Node.js + SWC preset should install and start without dependency conflicts.

The generator should either:

  • use a TypeScript version supported by @swc-node/register, or
  • use an @swc-node/register version that supports TypeScript 7.

Acceptance criteria

  • A project generated with the Node.js + SWC preset installs successfully with npm install.
  • No peer dependency conflict exists between TypeScript and @swc-node/register.
  • npm start runs successfully with the generated dependency versions.
Ngôn ngữ chính
TypeScript
Star
43
Fork
25
Merge trung bình
15 phút
Pull request đã merge (30 ngày)
2

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

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 tsedio/tsed-cli

Tất cả issue của tsedio/tsed-cli

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.