-
Notifications
You must be signed in to change notification settings - Fork 404
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]: Decorators are broken when using useDefineForClassFields
#1960
Comments
@arturovt Sorry, my bad, I renamed the command sometime ago and didn't remember it. Anyways here's the updated one
I have updated in the details above too |
Hey, I was able to reproduce it and I'm still debugging it. I initially thought that might be an issue in some circular dependency between modules. But then I just created my own method decorator and used on the This might seem like a breaking change between TS versions, I'm not sure yet. Need more time. UPD: I've created a skeleton project that uses the same TS/tslib versions and |
Thanks for the update! The Typescript version is same across the entire application. Method decorators are used across the entire application at multiple places but they all are working fine. I'm wondering what'll be the cause of this error. So if it's not the bug from the NGXS, should I open it on the Typescript GitHub issues? |
I don't think this is the in NGXS. Eventually, all of the NGXS users would face this issue, but none of them did. |
What should I do? :') I've updated the dependencies but still the same result. Anyways, thanks for the help :) |
I will come back to your issue again a bit later. Users are facing decorators issues in other libraries as well, which means it's really something related to changes made in Angular. See this one ngneat/until-destroy#218 (comment). |
P.S. when I set |
I'd re-open this issue and discuss it with Mark. |
useDefineForClassFields
Any news on that? We also have the same problem. Using the We use "15.2.*" for the angular packages, tslib 2.3.0, typescript 4.8.2 and @ngxs/store 3.7.6-dev.master-6835a28. The latter is necessary for the removed "eivyEnabled" export in Angular 15 btw. For what date is the 3.8.0 release planned? |
Great news! v3.8.0 has been released and it includes a fix for this issue. |
Hi *, can someone confirm, that the issue is fixed? |
Pretty sure that it is not. I am also using 3.8.1 and ran into this issue. Setting useDefineForClassFields=false, everything works. I am using the following: NGXS 3.8.1 |
This is not fixed. Decorators do not work when |
Affected Package
The issue is caused by package @ngxs/store
Description
As mentioned in the docs here, I have created a memoized selector like so:
I have tried to debug as far as I could, it seems like the
__decorate
function created by typescript at compile time is receiving the following arguments at runtime forSelector
decorator which looks very suspicious:decorators
:[Selector, undefined, undefined, undefined]
// <= This undefined looks suspicioustarget
:class RouterDataState
key
:getRouteData
desc
:undefined
// <= This is undefined (which I guess shouldn't be)🔬 Minimal Reproduction
I tried to create a minimal reproduction example, but unable to reproduce the issue, seems like something's wrong with my project only. I have google the error, but seems there ain't one person who has faced this issue. So, I am leaving a link to my repo and steps to set it up
unstable-state/frontend-integration
npm i
npx nx run sca-fe:serve:dev
🔥 Exception or Error
Environment
The text was updated successfully, but these errors were encountered: