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

@computed decorator causing node ace to break #1057

Open
atharahmed opened this issue Oct 11, 2024 · 2 comments
Open

@computed decorator causing node ace to break #1057

atharahmed opened this issue Oct 11, 2024 · 2 comments
Assignees
Labels
Type: Bug The issue has indentified a bug

Comments

@atharahmed
Copy link

Package version

21.3.0

Describe the bug

I was rewriting my app in AdonisJS v6, and after updating the packages to the latest version, I started receiving the following error:

[ info ] starting HTTP server...

   SyntaxError: Invalid or unexpected token
 
   at (syntax error) SyntaxError: Invalid or unexpected token

To debug this, I started with a fresh AdonisJS installation using the api starter kit. When I created a model with the @computed() property, I encountered the same error, and the server wouldn’t even start.

If I remove that property, the server starts, but I get the following error:

{
"message": "Cannot read properties of undefined (reading 'attributesToColumns')",
"name": "TypeError",
"status": 500,
"frames": []
}

I can query the database just fine using the database query builder, but the ORM fails. I’m using Node v20.18.0.

It can be the possible duplicate of issue 1056

Reproduction repo

https://github.com/atharahmed/hello-world

@thetutlage
Copy link
Member

Hey!

Thanks for sharing the reproduction repo. The compiled output works fine, so it has to be something to do with SWC decorators support. Lemme debug further and see how that goes.

@thetutlage thetutlage self-assigned this Oct 11, 2024
@thetutlage thetutlage added the Type: Bug The issue has indentified a bug label Oct 11, 2024
@thetutlage
Copy link
Member

Its broken with @swc/core@1.7.35. If you downgrade to 1.7.26, it should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue has indentified a bug
Projects
None yet
Development

No branches or pull requests

2 participants