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

[Bug] 3.4.1 update breaks decorator #163

Closed
samchon opened this issue Oct 21, 2022 · 4 comments
Closed

[Bug] 3.4.1 update breaks decorator #163

samchon opened this issue Oct 21, 2022 · 4 comments
Labels
Bug Something isn't working

Comments

@samchon
Copy link

samchon commented Oct 21, 2022

After updating to 3.4.1 version, such error occurs.

If I rollback to previous version, the error be disappeard.

The one thing special is, such error occurs only when run by dynamic import statement with ts-node, but imported in a JS file. Type of decorator is not a matter.

TypeError: Cannot read properties of undefined (reading 'value')
    at D:\github\samchon\nestia\node_modules\@nestjs\common\decorators\http\request-mapping.decorator.js:15:76
    at D:\github\samchon\nestia\node_modules\@nestjs\common\decorators\core\apply-decorators.js:21:13
    at DecorateProperty (D:\github\samchon\nestia\node_modules\reflect-metadata\Reflect.js:553:33)
    at Reflect.decorate (D:\github\samchon\nestia\node_modules\reflect-metadata\Reflect.js:123:24)
:1180:10)    at Object.require.extensions.<computed> [as .ts] (D:\github\samchon\nestia\node_modules\ts-node\src\index.ts:1600:12)
@samchon
Copy link
Author

samchon commented Oct 21, 2022

@samchon
Copy link
Author

samchon commented Oct 21, 2022

@nonara Same error on v3.4.2

@nonara
Copy link
Collaborator

nonara commented Oct 21, 2022

Thanks for the report!

I've cloned and done some preliminary investigation. From what I can tell the PropertyDescriptor is not being passed from the compiled __decorate() function in controller.ts.

Notably, I would point out that 3.3.x did not properly support TS 4.8, because TS merged Decorators and Modifiers in their AST. It also didn't properly support ts-node when not run in transpileOnly mode.

There is a chance that what you are seeing is a result of these modes being supported, and it may not be a bug within TSTP, itself.

The best way to track this out is to get at the compiled source for controller.ts and then determine exactly why it's not passing a property descriptor with one version vs. the other.

Unfortunately, I don't have the time right now to continue tracking this out. I've spent the last two days during a heavy work week doing the fixes I could. If you're able to tag in and do some debugging to figure out more about what is happening, you can keep me in the loop in this thread and I can help get it done. I just don't have the bandwidth right now to do in depth debugging.

@nonara nonara changed the title 3.4.1 update breaks decorator [Bug] 3.4.1 update breaks decorator Oct 21, 2022
@nonara nonara added Bug Something isn't working and removed Needs Investigation labels Oct 21, 2022
@nonara
Copy link
Collaborator

nonara commented Oct 21, 2022

Never mind! I had a thought on this and did a little more digging. Thanks for reporting this.

It is corrected in v3,4,3, Let me know if you have any further issues.

@nonara nonara closed this as completed in b297431 Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants