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

Aperta
#616 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Romakita ci sta già lavorando.

Dal 7/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
TypeScript
Stelle
43
Fork
25
Merge medio
15m
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tsedio/tsed-cli

Tutte le issue di tsedio/tsed-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.