-
Notifications
You must be signed in to change notification settings - Fork 511
Angular 6: "Cannot read property 'CLASS_TO_PLAIN' of undefined" when using the buildOptimizer
#147
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
Comments
…shim for node global object to polyfill (fixes: angular/angular-cli#9827 (comment)) Note: at some point in time those two hacks should be removed
i have the same problem too |
This is an issue with the angular build-optimizer and has been discussed here. As per this comment, the issue should be fixed. However, it seems like there is a regression in the full release of v6 which causes the enums to be stripped out again:
A workaround is described here I have forked export enum TransformationType {
PLAIN_TO_CLASS = "0",
CLASS_TO_PLAIN = "1",
CLASS_TO_CLASS = "2"
} If you would like I can open a PR with the changes, however I don't know if that would be fitting as the described behavior is a bug in angular and not in |
…move duplicate definition and use strings for the enum type. Fixes typestack#147 See also: angular/angular-cli#7613 (comment)
This issue has now been fixed in v6.0.1 of the angular devkit (angular/devkit@959826b). Closing this issue. |
Thanks for the clear explanation for the future readers. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hey all!
I'm using
class-transformer
in my angular app. I recently upgraded the project to Angular 6 andclass-transformer
started throwing the following exceptions when transforming from class to plain and from plain to class:I noticed that those issues only occur when enabling the
buildOptimizer: true
inangular.json
. I would appreciate any help on the matter!The text was updated successfully, but these errors were encountered: