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

Internet Explorer Syntax error #1496

Closed
cdatehortuab opened this issue Dec 18, 2017 · 11 comments · Fixed by #1502
Closed

Internet Explorer Syntax error #1496

cdatehortuab opened this issue Dec 18, 2017 · 11 comments · Fixed by #1502
Assignees

Comments

@cdatehortuab
Copy link

Hello, this addon has a little issue when running a project including it in Internet Explorer.

The problem is browser says in this line:
https://github.com/simplabs/ember-simple-auth/blob/50adfeb515f5983287695d0e3eeba814c308d79f/addon/session-stores/cookie.js#L298
there is a Syntax error.

So, the project never runs.

Thank you.

@marcoow
Copy link
Member

marcoow commented Dec 19, 2017

This should actually be transpiled by Babel. Which version of IE do you see the error in? What does your config/targets.js look like?

@marcoow marcoow added the triage label Dec 19, 2017
@mdeanjones
Copy link

For a vanilla targets.js of

module.exports = {
  browsers: [
    'ie 9',
    'last 1 Chrome versions',
    'last 1 Firefox versions',
    'last 1 Safari versions'
  ]
};

the transpiled line becomes

_warn: function _warn() {
      (true && Ember.warn(...arguments));
}

making it the sole remaining splat in the output. Not sure if this one is on Babel.

@marcoow
Copy link
Member

marcoow commented Dec 19, 2017

I think this relates to @ember/debug being a special module that has all of its exports disabled in production builds. In development env,

_warn() {
  warn(...arguments);
}

becomes

_warn: function _warn() {
  (true && Ember.warn(...arguments));
}

while in production it becomes

_warn: function _warn() {
  (false && Ember.warn(...arguments));
}

which effectively disables the call to Ember.warn. Pure Babel compiles the method to

_warn: function _warn() {
  _debug.warn.apply(undefined, arguments);
}

which seems correct. To me this looks like a bug in the AST transform doing this special handling of @ember/debug. @Turbo87 might have an idea whether this has maybe been fixed already or where exactly this happens.

@Turbo87
Copy link
Collaborator

Turbo87 commented Dec 20, 2017

see ember-cli/babel-plugin-debug-macros#47

@marcoow marcoow self-assigned this Dec 20, 2017
@marcoow marcoow removed the triage label Dec 20, 2017
@cah-danmonroe
Copy link

Yay, I just spent the last 4 hours tracking this down to pin point it to ember-simple-auth from 1.4.0 to 1.4.1. I came here to report it but I guess I was a little late.

IE 10 and 11 for us.

@rwjblue
Copy link
Contributor

rwjblue commented Dec 22, 2017

😩 sorry for not getting that upstream issue fixed already, haven't had the time to dig into it yet 😭

@andyhot
Copy link

andyhot commented Dec 24, 2017

Also getting this with phantomjs in our automated tests

@andyhot
Copy link

andyhot commented Dec 24, 2017

@marcoow Would you be open to a PR that directly calls @ember/debug's warn instead of this._warn (and hopefully a quick bug release after that)?

@Turbo87
Copy link
Collaborator

Turbo87 commented Dec 24, 2017

I've opened a PR to work around the issue for now (#1502)

@ivp-dev
Copy link

ivp-dev commented Dec 27, 2017

this error has killed my day (

@Turbo87
Copy link
Collaborator

Turbo87 commented Dec 27, 2017

Once CI is finished this will be released as v1.4.2

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

Successfully merging a pull request may close this issue.

8 participants