ember-polyfills / ember-cached-decorator-polyfill

Polyfill for RFC 566: @cached
MIT License
20 stars 6 forks source link

Haxx to ember-cli-babel seem to be failing on Ember 3.27.0-beta1 #77

Closed acorncom closed 3 years ago

acorncom commented 3 years ago

As first mentioned by @boris-petrov in https://github.com/ember-polyfills/ember-cached-decorator-polyfill/issues/70#issuecomment-843790181, the release of ember-cli-babel@7.26.6 seems to have unblocked parts of the ecosystem. But this addon seems to have issues with the new approach, somehow related to the haxx introduced in https://github.com/ember-polyfills/ember-cached-decorator-polyfill/pull/12 ?

Reproduction available here: https://github.com/acorncom/cached-decorator-babel-issues-reproduction (latest ember-cli-babel@7.26.6 is in use there)

In my case, the error thrown is:

applyDecoratedDescriptor.js:16 Uncaught TypeError: decorator is not a function
    at eval (applyDecoratedDescriptor.js:16)
    at Array.reduce (<anonymous>)
    at _applyDecoratedDescriptor (applyDecoratedDescriptor.js:15)
    at eval (test-component.js:49)
    at Module../components/test-component.js (chunk.d76dcaa29bf3c00d6f74.js:92)
    at __webpack_require__ (chunk.7e29ea896c9f6f20b6e2.js:80)
    at Module.eval [as callback] (module-issues.js:70)
    at Module.exports (loader.js:106)
    at requireModule (loader.js:27)
    at Class._extractDefaultExport (index.js:466)

and that seems to be getting thrown by ember-page-title. But that wasn't a problem until I imported cached and used it.

rwjblue commented 3 years ago

Fixed by #75, can you confirm @acorncom ?

rwjblue commented 3 years ago

https://github.com/ember-polyfills/ember-cached-decorator-polyfill/releases/tag/v0.1.2

rwjblue commented 3 years ago

I confirmed locally that https://github.com/acorncom/cached-decorator-babel-issues-reproduction/pull/1 successfully prints the text with both Embroider and non-Embroider builds.