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

IE11 Out of stack space #686

Closed
kane-mason opened this issue Nov 1, 2019 · 21 comments
Closed

IE11 Out of stack space #686

kane-mason opened this issue Nov 1, 2019 · 21 comments

Comments

@kane-mason
Copy link

We use core js in a games engine and recently updated from 2.5.7 to 2.6.0 but are facing an "Out of stack space" error happening in Internet Explorer 11 (Build 11.805.17763.0 on Windows 10). See picture below of stack trace:

image

@zloirock
Copy link
Owner

zloirock commented Nov 1, 2019

core-js@2.6.0 is an obsolete version and no longer supported. Anyway, without a reproducible example, I can't say anything.

@kane-mason
Copy link
Author

Well the same error happens on all versions after 2.5.7, even the latest 3.3.6, i thought providing the version number where it started happening would help identify the change that introduced it. Unfortunately IE11s poor debugging tools i am having a hard time locating exactly where it happens. Will try get some more info, otherwise could share a link with you privately

@mikea
Copy link

mikea commented Nov 5, 2019

I'm having the same issue in IE11 while trying to upgrade to corejs3. Trying to understand what happens (ie11 debugging tools are terrible)

@mikea
Copy link

mikea commented Nov 5, 2019

After lots of debugging it seems that first stack overflow happens in dom-collections.iterable:

https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/web.dom-collections.iterator.js#L17

Happens on the first loop iteration with COLLECTION_NAME==="CSSRuleList"
which gets infinite loop in es.symbol:

https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.symbol.js#L170

Screen Shot 2019-11-04 at 5 18 04 PM

@zloirock @kane-mason

@zloirock
Copy link
Owner

zloirock commented Nov 5, 2019

That looks like a conflict with another Symbol polyfill (not 100%). core-js well-known symbols, like @@iterator on CSSRuleList haven't this setters-related logic.

@mikea
Copy link

mikea commented Nov 5, 2019 via email

@zloirock
Copy link
Owner

zloirock commented Nov 5, 2019

Create a reproducible example? -)

@mikea
Copy link

mikea commented Nov 5, 2019 via email

@zloirock
Copy link
Owner

zloirock commented Nov 5, 2019

It's "another polyfill" case only if it happens here. It looks like #163. Well-known core-js symbols are protected from it since they don't add setters, but in your stack trace, we see the symbol polyfill setters.

@mikea
Copy link

mikea commented Nov 5, 2019

@zloirock thanks, I'll try to dig through those bugs and see if it applies to us.
For what it is worth, I believe we have 0 explicit usages of Symbol in our code base. Looks like usage is coming from core-js itself.

@kane-mason
Copy link
Author

Ok, so got to the bottom of our issue. We have a game wrapper bundle that gets injected moments before the game bundle, and it is also using core-js, but a much older version 1.2.5. Best i can tell is the our newer core-js comes along and completes some partial polyfills and does some new ones, but the combination of the older and newer core-js just won't work. To be expected really

@mikea
Copy link

mikea commented Nov 5, 2019

I need to double-check things, but it seems that bad symbol comes from object.assign which comes from babel:

├─┬ @babel/preset-env@7.6.3
│ └─┬ @babel/plugin-transform-modules-amd@7.5.0
│   └─┬ babel-plugin-dynamic-import-node@2.3.0
│     └── object.assign@4.1.0  deduped

@mikea
Copy link

mikea commented Nov 5, 2019

And related object.assign issue could be: ljharb/object.assign#17

@zloirock
Copy link
Owner

@mikea the mentioned issue is not related to this recursion.

@zloirock
Copy link
Owner

Could you show me your babel config? Something like that possible in some incorrect cases usage of both - global and pure versions of core-js together.

@mikea
Copy link

mikea commented Nov 18, 2019

Here it is:

const presets = [
  [
    "@babel/preset-env",
    {
      targets: {
        browsers: ["last 2 versions", "ie >= 10", "chrome >= 41", "safari >= 9"],
      },
    },
  ],
  "@babel/preset-typescript",
  "@babel/preset-react",
];

const plugins = [
  [
    "@babel/plugin-transform-runtime",
    {
      corejs: 3,
      absoluteRuntime: true,
    },
  ],

  // Babel has killed stages: https://babeljs.io/blog/2018/07/27/removing-babels-stage-presets
  // Stage 2
  [
    "@babel/plugin-proposal-decorators",
    {
      legacy: true,
    },
  ],
  "@babel/plugin-proposal-function-sent",
  "@babel/plugin-proposal-export-namespace-from",
  "@babel/plugin-proposal-numeric-separator",
  "@babel/plugin-proposal-throw-expressions",

  // Stage 3
  "@babel/plugin-syntax-dynamic-import",
  "@babel/plugin-syntax-import-meta",
  [
    "@babel/plugin-proposal-class-properties",
    {
      loose: false,
    },
  ],
  "@babel/plugin-proposal-json-strings",

  // see https://github.com/babel/babel/issues/8244
  // we use custom namespaces in DomJSX
  "babel-plugin-typescript-strip-namespaces",
];

module.exports = {
  sourceType: "unambiguous",
  presets,
  plugins,
};

@zloirock
Copy link
Owner

@mikea so, in your case, the error comes from core-js or core-js-pure?

@zloirock
Copy link
Owner

Could you check it with the current version?

@zloirock
Copy link
Owner

Closed due to lack of response. Most likely, it was fixed after adding this workaround.

@tonoslav
Copy link

@zloirock
Just to ask, why there is all those "Symbol()..." object attributes added to everyobject I use in IE?

@zloirock
Copy link
Owner

@tonoslav we should hide polyfilled symbols from almost all ways of iteration includes for-in loop, adding setters to Object.prototype is the only way to make it work properly.

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

4 participants