node-process: 0.11.2 breaks IE11 compat

I don’t have the necessary environment right now to be able to repro this in a way that I can share. In a nutshell this is how I would presume you would repro this issue.

Environment Windows 7/IE 11

Some stuff that goes into the <head/> tag.

<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/core-js/2.1.3/shim.min.js' type='text/javascript'></script>

Using webpack with the following config to inject bluebird as the default Promise implementation everywhere. Webpack entry config as follows:

entry: [
  'any-promise/register/bluebird',
  'expose?Promise!any-promise', // make bluebird the de-facto Promise everywhere
  ...
],
...

In this case I was using popsicle to fetch a resource (JSON document) and that’s when the issue occurred. There is a relationship between any-promise and popsicle for that reason I think it might be necessary to use popsicle for a successful repro.

See comments on this commit for more information.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 20

Commits related to this issue

Most upvoted comments

so the eval is only there in order to create source maps so thats not an issue.

so for eval screwing stuff up, basically there is something wonky and wrong in how eval and setTimeout come together in IE11.

setTimeout issue

IE11 has an extra/unneeded test to check what the ‘this’ value of setTImeout is and seems to throw if it is defined but not window, in other words ({setTimeout:setTimeout}).setTimeout(function (){console.log('hello')}) throws an error in IE11

eval

this is happening with eval because eval changes the context of where code is run which seems to be causing the context of the setTimeout to change causing it to throw the error