Core-js: IE 11 issue with setImmediate + webpack dev server

Created on 2 May 2015  路  20Comments  路  Source: zloirock/core-js

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:

https://github.com/acdlite/flummox/issues/167

References:
https://github.com/caolan/async/issues/299
https://github.com/substack/node-browserify/issues/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
https://github.com/facebook/fixed-data-table/issues/15
https://github.com/jquense/react-widgets/issues/91

compatibility

Most helpful comment

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.

All 20 comments

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?

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

@box-turtle any news?

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

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.

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

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

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

Due to the lack of reproducible example - close issue.

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

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

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

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) =)

@ALF-er interesting, thanks.

\cc @sokra

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

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

Thanks!

@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.

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vetruvet picture vetruvet  路  5Comments

flcl42 picture flcl42  路  4Comments

yusidi picture yusidi  路  3Comments

brunops picture brunops  路  3Comments

sgammon picture sgammon  路  6Comments