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

Error: Decorating class property failed. Please ensure that proposal-class-properties is enabled and runs after the decorators transform. #447

Open
NullVoxPopuli opened this issue Jun 8, 2022 · 2 comments

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jun 8, 2022

This error occurs when I'm consuming a V2 addon that has not complied away class properties.

This is incorrect behavior, because

  • my browsertargets all support class properties
  • the app has proposal-class-properties, so it should use that
  • how does this end up working for regular v2 packages? have we always not been able to use class properties?

Is there a way to tell ember-cli-babel to ignore v2 addons? or maybe only run "if it needs to"?
I guess maybe a core_er_ issue is that ember-cli-babel is incorrectly determining that it needs to run on the v2 addons?

NullVoxPopuli added a commit to CrowdStrike/ember-toucan-styles that referenced this issue Jun 8, 2022
ember-cli-babel is super buggy with modern packaging, it seems.
See: emberjs/ember-cli-babel#447
@NullVoxPopuli
Copy link
Contributor Author

NullVoxPopuli commented Sep 10, 2022

Here is a reproduction: NullVoxPopuli/ember-resources#616
this PR demonstrates that by not compiling away properties, you can see from a 5% to 68% reduction in files size (after minification)

the ember app gives this error:

Error: Decorating class property failed. 
Please ensure that proposal-class-properties is enabled and runs after the decorators transform.

@NullVoxPopuli
Copy link
Contributor Author

ah ok, getting context back now -- I saw this in the babel output:

function _initializerWarningHelper(descriptor, context) {
  throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.');
}


how rude

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