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

wtr: fails to compile standard decorators #2757

Open
tpluscode opened this issue Jun 21, 2024 · 2 comments
Open

wtr: fails to compile standard decorators #2757

tpluscode opened this issue Jun 21, 2024 · 2 comments

Comments

@tpluscode
Copy link

tpluscode commented Jun 21, 2024

I have been recently struggling with lit where it complained about shadows class fields. While exploring options to address that issue, I found that WTR fails to compile my elements with lit decorators. Simply gives me

SyntaxError: Invalid or unexpected token

Repro on master branch: https://github.com/tminuscode/wtr-decorators

Also fails Works with legacy decorators: https://github.com/tminuscode/wtr-decorators/tree/legacy-decorators, when tsconfig path is

Either way works fine when compiling to JS first: https://github.com/tminuscode/wtr-decorators/tree/js

This is the behavior with @web/[email protected].

@tpluscode tpluscode changed the title wtr: fails to compile standard decorators wtr: fails to compile decorators Jun 21, 2024
@tpluscode
Copy link
Author

I also tried with @web/[email protected].

"useDefineForClassFields": false has no effect and I still get the shadowing error from lit. Trying to add the accessor keyword results in a different error from wtr

Error while transforming elements.ts: Expected ";" but found "name"
   7 |
   8 |     @property({ type: String })
>  9 |     accessor name: string = "Sombeody"

@tpluscode
Copy link
Author

I further tried adding tsconfig path in wtr config as mentioned on lit/lit#3807 but it made no difference

@tpluscode tpluscode changed the title wtr: fails to compile decorators wtr: fails to compile standard decorators Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant