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

Re-exporting a module compiles to 'exports.default = ...` #49

Closed
alexlafroscia opened this issue Jul 29, 2015 · 3 comments
Closed

Re-exporting a module compiles to 'exports.default = ...` #49

alexlafroscia opened this issue Jul 29, 2015 · 3 comments
Labels

Comments

@alexlafroscia
Copy link
Contributor

I've been doing some IE debugging and noticed a show-stopper that seems to fall into Babel's territory. I keep getting the following issue:

Expected Identifier

Which traces back to the following code:

define('qualaris-mantra/components/ember-wormhole', ['exports', 'ember-wormhole/components/ember-wormhole'], function (exports, ember_wormhole) {

    'use strict';

    exports.default = ember_wormhole.default; // Error points to this line

});

I went and looked up the ember-wormhole code that corresponds to this module, and it can be found here. In case you don't feel like following the link, it's just re-exporting another module.

Is this an issue on Babel's end? To me, it seems like the problem is that Babel translates the re-export to

exports.default = ember_wormhole.default;

instead of

exports['default'] = ember_wormhole['default'];

I looked around at all the other modules and they all seem to use the exports['default'] syntax. It's only an issue with IE, and all the other modules seem to be OK.


This was originally opened as an issue as an issue on Babel's repo but we determined that it's probably not an issue with Babel's core. It think it's more likely that the problem is with the transformation the the CLI uses to handle modules instead.

@stefanpenner
Copy link
Member

confusingly this is a bug in esperanto esperantojs/esperanto#176

@alexlafroscia
Copy link
Contributor Author

Huh, alright then! Thanks for the follow-up 😄

@stefanpenner
Copy link
Member

ember-cli/ember-cli#4545 will fix it. I plan to release another ember-cli this afternoon.

@Turbo87 Turbo87 added the bug label Dec 5, 2016
siva-sundar pushed a commit to siva-sundar/ember-cli-babel that referenced this issue Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants