You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] SWC preset generates project with TypeScript 7 incompatible with @swc-node/register #616
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.
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.
Activity
Romakita commentedon Oct 8, 2026
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 ?
vrilcode commentedon Oct 8, 2026
Thanks for the clarification. I only tried swc because it was the default in the CLI. Vite feels more familiar to me anyway.
Romakita commentedon Oct 8, 2026
Ha ok I have to change that :D