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

Throws when used with ember-cli-babel includeExternalHelpers: true #341

Closed
makepanic opened this issue Dec 8, 2020 · 0 comments · Fixed by #342
Closed

Throws when used with ember-cli-babel includeExternalHelpers: true #341

makepanic opened this issue Dec 8, 2020 · 0 comments · Fixed by #342

Comments

@makepanic
Copy link
Contributor

makepanic commented Dec 8, 2020

Hi,

when using ember-cli-flash in a project that enables includeExternalHelpers in its ember-cli-babel settings, the transpiled code will throw.

This happens because the addon/flash/object defines a Object class. During the transpilation babel adds the esModule marker:

Object.defineProperty(_exports, "__esModule", {
    value: true
});

// ...

var Object = (_dec = (0, _computed.guidFor)('message').readOnly(), (_class = (_temp = /*#__PURE__*/function (_Ember$Object$extend) {

Due to variable hoisting, it'll try to call defineProperty on the class that ember-cli-flash defined.

If it's ok, I'll open a PR to rename that class name to something like FlashObject which prevents this from happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant