karol-f / vue-custom-element

Vue Custom Element - Web Components' Custom Elements for Vue.js
https://karol-f.github.io/vue-custom-element/
MIT License
1.97k stars 187 forks source link

IE 10: TypeError: Unable to get property 'create' of undefined or null reference #148

Closed wbern closed 6 years ago

wbern commented 6 years ago

Hi and thanks for maintaining this project!

We have an issue with IE 10 where we use babel-polyfill and all babel transpilation steps.

It would seem your isES2015() function is returning true in our environment because Reflect and Symbol both exist, but when the code tries to use the ES2015 approach we get the following exception.

TypeError: Unable to get property 'create' of undefined or null reference
   at CustomElementsV1 (eval code:1429:15)
   at construct (http://13.11.7.3:41690/.resources/team/resources/js/bundle.53ec7fd0f72e0a3e7677.js:93:128243)
   at _CustomElement (eval code:38:3)
   at CustomElement (eval code:83:9)
   at value (eval code:1329:13)
   at setupNode (eval code:1221:7)
   at patchIfNotAlready (eval code:747:13)
   at setupAll (eval code:1201:17)
   at cloneNode (eval code:1003:11)
   at Cn (http://13.11.7.3:41690/.resources/team/resources/js/bundle.53ec7fd0f72e0a3e7677.js:78:14463)<div class="ng-scope" style="position: relative;" data-ng-transclude="">

It fails specifically at code that says new Target().

When we hack your solution to make isES2015() return false, it works.

karol-f commented 6 years ago

Hi, if Reflect and Symbol both exist it might be problem with some pollyfills? It shouldn't be available IE11.

I can add more checks to isES2015() method. Can you tell me what typeof Proxy returns in your IE11?

anderssonsebastian111 commented 6 years ago
typeof Proxy
"undefined"
wbern commented 6 years ago

Also please see this issue for reference, so you don't falsely accept proxy polyfills (which aren't 1:1 with native proxies)

https://github.com/facebook/react/issues/12011

karol-f commented 6 years ago

@wbern please check vue-custom-element@3.2.6 and let me know if it works as expected.