-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SyntaxError: Unexpected token '?' #722
Comments
Also happens for me when running: SWCRC=true node --loader @swc-node/register/esm scripts/run-local.ts
|
the same here
> npm run swagger && SWCRC=true dotenv -e .env.local -- node --import @swc-node/register/esm-register src/server.ts
> tsoa spec-and-routes
file:///.........backend/build/routes.ts:7
import type { Request as ExRequest, Response as ExResponse, RequestHandler, Router } from 'express';
^
SyntaxError: Unexpected token '{'
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:155:18)
at callTranslator (node:internal/modules/esm/loader:285:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:30)
Node.js v20.10.0
|
Do you have a minimal reproduction? |
hey @kdy1 I've created repo https://github.com/mishelen/tsoa-swc/tree/main |
if I manually remove file:///.../build/routes.ts:13
const models: TsoaRoute.Models = {
^^^^^^
SyntaxError: Missing initializer in const declaration Uhhh, but it IS initialized. Even more I don't see any errors from TS in that file in the IDE. |
function fun(a?:string){
^
SyntaxError: Unexpected token '?'
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:119:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:468:14)
at async link (node:internal/modules/esm/module_job:68:21)
Node.js v18.16.1
The text was updated successfully, but these errors were encountered: