Open ElMehdiBouamama opened 1 year ago
Is this issue related to the one I have? https://github.com/swc-project/swc-node/issues/701
I am still trying to figure out how to fix this issue. Please if anyone can help I would be more than grateful!
Is this repository still maintained?
@ElMehdiBouamama you should provide a minimal reproducible repo for your issue so that I can debug it
Got the same issue. @Brooooooklyn could you help.
tsconfig.json
{
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ESNext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true
}
}
Small example to reproduce:
src/server.ts
import { Module } from '@nestjs/common';
@Module({})
export class AppModule {}
run
SWCRC=true SWC_NODE_PROJECT=./tsconfig.json node --import @swc-node/register/esm-register ./src/server.ts
Error:
Node.js v22.7.0
node:internal/modules/run_main:123
triggerUncaughtException(
^
[Error: x Expression expected
,-[file:///src/server.ts:3:1]
1 | import { Module } from '@nestjs/common';
2 |
3 | @Module({})
: ^
4 | export class AppModule {}
`----
Caused by:
Syntax Error] {
code: 'GenericFailure'
}
node: 22.7.0 pnpm: 9.7.1 typescript: 5.5.4
@swc-node/register 1.10.9
├─┬ @swc-node/core 1.13.3
│ └── @swc/core 1.7.14 peer
When trying to transcompile my typescript files I get this error :'(
Node: 19.8.1 Npm: 9.6.2
Here is my .swcrc file:
Here is my tsconfig.json file:
Any idea on how to fix the issue? Thank you in advance i have been stuck with this issue since 3 days now :(
Side note: The error appeared once I upgraded my node version to 19.x