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

Parameter Decorators leads to error "Cannot read properties of undefined (reading 'prototype')" #103

Open
mav-rik opened this issue Dec 22, 2022 · 0 comments

Comments

@mav-rik
Copy link

mav-rik commented Dec 22, 2022

Environment

node v18, jiti v1.16.0

Reproduction

Bug appears when using method & parameter decorator together like:

class MyApp {
    @Get('test')
    test(@Query() query) {
        // ...
    }
}

Describe the bug

The plugin babel-plugin-parameter-decorator generates a buggy piece of code that leads to an error "Cannot read properties of undefined (reading 'prototype')"

The problem is mentioned here.

The author of babel-plugin-parameter-decorator doesn't seem to want to fix it.

The solution proposed here.

Additional context

As a solution I suggest to switch from @babel/plugin-proposal-decorators & babel-plugin-parameter-decorator to proposed babel-plugin-typescript-decorators.

Logs

TypeError: Cannot read properties of undefined (reading 'prototype')
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