ember-polyfills / ember-cached-decorator-polyfill

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

^v0.1.2 cached is undefined #81

Open betocantu93 opened 3 years ago

betocantu93 commented 3 years ago

Hello, not really sure if there's anything special about our setup... yet, but wanted to open an issue for documentation, we had to lock-in for v0.1.1 because starting from 0.1.2 cached import resolves undefined. Gonna try to create a repro.

"ember-source": "3.20.2" "ember-cli": "3.20.0"

SergeAstapov commented 3 years ago

Confirm, see the same behavior with v0.1.3.

Here is transpiled output: ember-cached-decorator-polyfill #81

Interestingly, debugger never gets to this line https://github.com/ember-polyfills/ember-cached-decorator-polyfill/blob/main/lib/transpile-modules.js#L62

I wonder if something else strips the import before...

kellyselden commented 3 years ago

We are getting the following build error when trying to update to 0.1.2.

@glimmer/tracking does not have a cached export

rwjblue commented 3 years ago

@kellyselden generally speaking, that seems like it would be caused by running with too old of an ember-cli-babel version (this error comes from babel-plugin-ember-modules-api-polyfill, which uses the list of known modules <-> Global's paths from ember-rfc176-data). Can you double check the version of ember-cli-babel that is used by whomever is using @cached?

rwjblue commented 3 years ago

@betocantu93 / @SergeAstapov - have y'all been able to isolate a reproduction?

kellyselden commented 3 years ago

Thanks @rwjblue, I'll try that first.

betocantu93 commented 3 years ago

@rwjblue Here's a repro: https://github.com/betocantu93/bug-repro

Can you double check the version of ember-cli-babel that is used by whomever is using @cached?

Indeed, one of my deps where @cached is used has "ember-cli-babel": "^7.13.0" which seems to be causing the issue

SergeAstapov commented 3 years ago

I've got trolled by ember-a11y-testing@3.0.2 which has pinned version of ember-cli-babel in https://github.com/ember-a11y/ember-a11y-testing/blob/v3.0.2/package.json#L29 🙈

Thanks for pointing out into root cause @rwjblue!