Skip to content
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

TC39 stage 3 decorators do not work with bundle or compile #22419

Closed
tdillon opened this issue Feb 14, 2024 · 2 comments
Closed

TC39 stage 3 decorators do not work with bundle or compile #22419

tdillon opened this issue Feb 14, 2024 · 2 comments
Labels
bug Something isn't working correctly compile related to the `deno compile` feature

Comments

@tdillon
Copy link

tdillon commented Feb 14, 2024

$ deno --version
deno 1.40.4 (release, x86_64-pc-windows-msvc)
v8 12.1.285.6
typescript 5.3.3

The TC39 stage 3 decorators sample provided by https://deno.com/blog/v1.40#decorators does not work with bundle or compile. Given bundle has been deprecated 😢 I can understand why it wouldn't matter too much, but I assume decorators should still work with compile. The compile command successfully creates an executable, but an error occurs when running the executable.

$ ./sample.exe
error: Uncaught SyntaxError: Invalid or unexpected token
  @trace
  ^
    at <anonymous> (file:///C:/.../sample.ts:10:3)
@tdillon tdillon changed the title TC39 stage 3 decorators do now work with bundle or compile TC39 stage 3 decorators do not work with bundle or compile Feb 15, 2024
@dsherret dsherret added bug Something isn't working correctly compile related to the `deno compile` feature labels Feb 15, 2024
@cleverplatypus
Copy link

cleverplatypus commented Feb 16, 2024

Same issue here. I haven't been able to deploy to Deno Deploy anymore in the past few days. It took some effort to figure out that the problem was the use of decorators, which my app relies heavily on.
On a side note, Deno Deploy has the horrible "habit" of truncating stack traces, so I wasn't even able to figure out what the offending line was.

My deno.jsonc contains the experimental config setting.

{
//...
 "compilerOptions": {
    "experimentalDecorators": true
  }
//...
}

Indeed running deno compile src/server.ts I get the same error, so, I guess deno deploy compiles the app in the same way.

image

@lucacasonato
Copy link
Member

This is now fixed for deno compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly compile related to the `deno compile` feature
Projects
None yet
Development

No branches or pull requests

4 participants