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

IE 11 issue with setImmediate + webpack dev server #62

Closed
box-turtle opened this issue May 1, 2015 · 20 comments
Closed

IE 11 issue with setImmediate + webpack dev server #62

box-turtle opened this issue May 1, 2015 · 20 comments

Comments

@box-turtle
Copy link

I reported this on the babel project and @sebmck said I should report it over here.

Using babel/core.js with projects that rely on requestAnimationFrame or setImmediate I see "Invalid Calling Object" errors when viewing in IE 11 on Windows 7.

I believe that when you alias setImmediate in IE you have to first bind the function to a calling object.

Here is the specific issue I hit with the Flummox project:

acdlite/flummox#167

References:
caolan/async#299
browserify/browserify#237
https://msdn.microsoft.com/library/gg622930(v=vs.85).aspx

Specific code for the Flummox issue is a Flummox action class that utilizes async/await. Babel is being run with stage=0.

'use strict';

import {Actions} from 'flummox';
import request from '../util/HttpRequest';

export default class MessageActions extends Actions {

  async getAllMessages() {
    try {
      let response = await request.get('/api/messages').exec();
      return response.body;
    } catch (err) {
      console.log(err);
    }
  }

  async getMessage(id) {
    try {
      let response = await request.get(`/api/messages/${id}`).exec();
      return response.body;
    } catch (err) {
      console.log(err);
    }
  }
}

After transpilation by webpack, when I load the page in the dev server, the error "Invalid Calling Object" occurs in the file es6.promise.js at the line:

if(isReject || chain.length)asap(function(){

The error only occurs in IE, works fine on mac/win firefox/safari/chrome.

Similar issues with requestAnimationFrame
facebookarchive/fixed-data-table#15
jquense/react-widgets#91

@zloirock
Copy link
Owner

zloirock commented May 4, 2015

Strange. In core-js setImmediate called without changing context. I can't reproduce problem. Can you show me broken example in core-js or babel REPL?

@box-turtle
Copy link
Author

Thanks for looking at this. I'll get a reproducible example together in the next day or so.

@zloirock
Copy link
Owner

zloirock commented May 7, 2015

@box-turtle any news?

Already there was a similar issue, #49 cc @bloodyowl

@box-turtle
Copy link
Author

Sorry - been a crazy week at work - probably be the weekend.

Just to clarify - I only see this when I am running the code in webpack dev server. If I run a complete build to compile the code then the error does not occur - code runs fine in IE9 - 11.

So it could be this is not an issue with core.js but more environment related.

@bloodyowl
Copy link

yeah, I had the same issue there. it's really hard to reproduce given how badly the stacktraces show up.

@jareware
Copy link

Does core-js actually provide a requestAnimationFrame polyfill? Doesn't seem that way.

@zloirock
Copy link
Owner

@jareware do not provides, do not uses and there are no plans about it.

@zloirock
Copy link
Owner

Due to the lack of reproducible example - close issue.

@zloirock zloirock changed the title IE 11 issue with setImmediate, requestAnimationFrame Possible IE 11 issue with setImmediate May 11, 2015
@jwangnz
Copy link

jwangnz commented May 20, 2015

I'm also got this error under IE11 when running code in webpack dev server

@zloirock
Copy link
Owner

@Tsing looks like webpack issue, but I use it too without any problems. Can you add reproducible example?

@ALF-er
Copy link

ALF-er commented May 27, 2015

Hello (and sorry for my English), I have similar issue.

I'm using babel-core/polyfill which use core-js's Promise polyfill. And in IE I have error SCRIPT65535: Invalid calling object on line https://github.com/zloirock/core-js/blob/master/modules/es6.promise.js#L99 But I can't get what the problem =| (Additionally it's IE with its crappy dev tools, so I can't debug cuz it can't place brakepoint on eval-uated scripts). Any suggestions?

I've created repo to reproduce https://github.com/alf-er/wp_test
Simply npm install and then npm run dev

@ALF-er
Copy link

ALF-er commented May 27, 2015

Oh... I've found. It's happened because of eval of all modules in webpack if you use source-maps over eval (see http://webpack.github.io/docs/configuration.html#devtool) =)

@zloirock
Copy link
Owner

@ALF-er interesting, thanks.

@zloirock zloirock changed the title Possible IE 11 issue with setImmediate IE 11 issue with setImmediate + webpack dev server May 27, 2015
@zloirock
Copy link
Owner

\cc @sokra

@rafaelchiti
Copy link

Here a tiny repo with the issue https://github.com/rafaelchiti/ie9_issue_transpiled_code
npm install && make run (it opens on localhost:9090) if you open it on IE9 you will see the error, but yeah basically it happens when you have eval source map and you load the babel/polyfill on the page which under the hood loads core-js

@rafaelchiti
Copy link

@zloirock is this close here because it should go on babel? just making sure the debugging info is on the right ticket.

Thanks!

@zloirock
Copy link
Owner

zloirock commented Jun 2, 2015

@rafaelchiti I did not reopen this issue because rather it is webpack problem. Now I have a problem with free time - getting degree, when I'll be free I gonna try to fix it.

@zloirock
Copy link
Owner

zloirock commented Jun 5, 2015

If someone wanna fix it - available PR, in near days most likely I'll not have time.

@zloirock
Copy link
Owner

Should be fixed in 0.9.17, but I do not know what else can be expected from this buggy webpack + IE behavior.

@jonpincus
Copy link

Glad I ran into this thread. I had similar problems with a webpack-generated page on IE even though it wasn't using the webpack dev server. Changing the dev-tools config option to be "source-map" (as opposed to "eval-source-map") worked.

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

No branches or pull requests

8 participants