Skip to content

Syntax error when using --experimental-transform-types and a decorator #54901

Description

@damianobarbati

Version

v22.7

Platform

MacOS

Subsystem

No response

What steps will reproduce the bug?

git clone git@github.com:damianobarbati/ts-repro.git
pnpm install
pnpm start

Is the command missing something obvious?

node --no-warnings --experimental-transform-types --watch ./src/index.ts

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

Code should run.

What do you see instead?

$ pnpm start

file:///Users/damians/Desktop/ts-repro/src/Foe.ts:3
@log
^

SyntaxError: Invalid or unexpected token
at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:166:18)
at ModuleLoader. (node:internal/modules/esm/translators:540:10)
at callTranslator (node:internal/modules/esm/loader:436:14)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:442:30)
at async ModuleJob._link (node:internal/modules/esm/module_job:106:19)

Node.js v22.7.0
Failed running './src/index.ts'

Additional information

Something very stupid must be missing here in how I run the command?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidIssues and PRs that are invalid.wontfixIssues that will not be fixed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions