Closed m-mujica closed 5 years ago
@m-mujica what is core-js
... a babel polyfill? Where could one get it?
@justinbmeyer we get it through the babel-polyfill.
https://github.com/babel/babel/blob/master/packages/babel-polyfill/src/index.js#L15
core-js
is the polyfill we recommend in https://canjs.com/doc/guides/setup.html#IE11Support. You can get it from npm directly. core-js/web
is the module babel-polyfill
loads.
core-js/web
alone doesn't seem to cause this problem, but babel-polyfill
does. Still looking into this.
These keys (['_t', '_i', '_f', '_l', '_s']
) are the "symbols" created by our polyfill and assigned here: https://github.com/canjs/can-reflect/blob/07b65f19893d5b9ebe24b87574661c6ae4fa602f/types/map.js#L24-L30
I'm not exactly sure what the problem is yet, but it has something to do with how the core-js
Symbol polyfill creates Symbols that are not type "symbol"
. We have a few checks for Symbol support that just check if Symbol
and Symbol.for
exist, but we also check for the type in places like here:
After looking at this with fresh eyes, this is actually caused by core-js, but has been fixed in the 3.0 beta releases:
I ended up just replacing babel-polyfill with:
import ‘core-js/es6/symbol’;
import ‘regenerator-runtime/runtime'
since I only needed the Symbol
polyfill and the regenerator for the async/await stuff... Now the app loads fine.
@m-mujica fixed this by replacing babel-polyfill
with:
import "core-js/es6/symbol";
import "regenerator-runtime/runtime";
We also fixed how Symbols are handled:
Going to close this for now. If someone else runs into a case where babel-polyfill
does not work, we can re-open.
In IE11, if core-js is loaded, the Native Map gets some weird looking keys that can-reflect.each iterates on causing some errors across my app.
Ideally, can-reflect.each should not iterate over this keys.