Skip to content

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

Open

Description

@vrilcode

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/register@1.12.1 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: tsed1@1.0.0
npm error Found: typescript@7.0.2
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/register@1.12.1
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.

Activity

  1. Romakita commented on Oct 8, 2026

    @Romakita
    Contributor

    Hello @vrilcode
    The problem is swc doesn't support tsc v7 isn't this case. The CLI always latest dependency to generate project up to date. The issue will persist until the swc team publish a new version.

    https://www.npmjs.com/package/@swc-node/register
    swc-project/swc-node#1049

    I don't want to pin the ts version to 6, because preset with vite works and this is the recommended way today to use it.

    Maybe it's time to deprecate swc preset ?

  2. added theissue type on Oct 8, 2026
  3. vrilcode commented on Oct 8, 2026

    @vrilcode
    Author

    Thanks for the clarification. I only tried swc because it was the default in the CLI. Vite feels more familiar to me anyway.

  4. Romakita commented on Oct 8, 2026

    @Romakita
    Contributor

    I only tried swc because it was the default in the CLI.

    Ha ok I have to change that :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions