Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

IE 11 error: Object doesn't support property or method 'call', File: webcomponents-lite.js, Line: 67, Column: 154 #103

Closed
ferroboyd opened this issue Jun 15, 2017 · 9 comments

Comments

@ferroboyd
Copy link

ferroboyd commented Jun 15, 2017

I made a new default app using the polymer starter kit and I built it using the es5-bundled preset. Will not work in IE11. Works fine in Chrome. Am I not understanding something with the support with polyfills or is this a bug?

Also getting this in console:

“Unable to get property ‘push’ of undefined or null reference" inside of CustomElementInternal.js (255,7)

@KamiQuasi
Copy link

May not be the exact same issue, but generates the error at will upon press of the "Remove" button (TypeScript transpiled with "none" modules and targeting es5; polyfill doesn't seem to work quite right in jsbin for IE, but the button still throws the same message):
https://jsbin.com/weregew/edit?html,js,console,output

The issue I'm having appears to be centered around this line (https://github.com/webcomponents/custom-elements/blob/master/src/Patch/Interface/ChildNode.js#L104) where, at least in the transpiled and minified code, the remove function does not exist at that point for IE11. IE11 does get polyfilled for window.Element.prototype.remove, but it doesn't seem like that is being referenced at that point in the code. The easiest way to recreate it is just to create a dummy element in script, transpile to es5, then on the page where you have the element run document.querySelector('dummy-element').remove()

@bicknellr
Copy link
Contributor

Hi, I've got a PR that's been out for a while that fixes this but it hasn't been reviewed unfortunately. :/ @KamiQuasi is right: the problem is that IE11 doesn't support remove but the polyfill adds this method unconditionally. Though, if you're using a polyfill for remove, you can put it in first and the custom elements polyfill should end up using the polyfilled remove.

@noamichael
Copy link

I'm having the exact same issue. Used the polyfill from the MDN and the exception seems to be gone.

@bicknellr
Copy link
Contributor

This should be fixed as of tag v1.0.3, let me know if it's not!

@jab
Copy link

jab commented Oct 3, 2017

@bicknellr I just tested a fresh build on a test site that included webcomponentsjs 1.0.14 in IE11, and am seeing this error message. Here's a screenshot:
screen shot 2017-10-02 at 20 50 01
Could I still be getting that if this were fixed, or could this be something else? I see webcomponents/webcomponentsjs#830 refers to the same error and is still open, so if that's a separate issue that I'm hitting, I'll track it there instead. (Btw the test site is at https://uproxy.github.io/uproxy.org/ in case it's helpful.)

@bicknellr
Copy link
Contributor

@jab, the specific error Object doesn't support property or method 'call' isn't unique to the particular issue fixed here in v1.0.3, it's just what IE says when you try to reference a property of an object and call it but that function doesn't exist. (For example, you can run ({}).noSuchFunction(1, 2, 3) in IE's console and it will throw an error with the message Object doesn't support property or method 'noSuchFunction'.)

I ran your site and it throws here, inside webcomponents-lite.js:
screen shot 2017-10-03 at 11 36 16
Which looks like it corresponds with this line in ShadyDOM:
https://github.com/webcomponents/shadydom/blob/3d94a2e4cb66563a043e9fc7ca2219e0ff9d8a3e/src/patch-events.js#L360
So the thing it's trying to call the call method on isn't a function (and doesn't have a handleEvent method). I haven't dug any deeper yet, but I'd double check that you're passing the right kind of thing to the unload listener you're setting.

@srijken
Copy link

srijken commented Oct 4, 2017

@bicknellr I'm seeing the exact same error, also on the unload listener. I don't use this listener myself though, so there's probably some other element that does. I tried searching, but haven't found the root cause.

@web-padawan
Copy link

@srijken BTW, window.onunload is equal to null by default for me, at least in Chrome.

How to check:

  1. open about:blank
  2. open console (F12 in IE)
  3. type window.onunload

@srijken
Copy link

srijken commented Oct 4, 2017

OK, found the likely culprit. We were still using a 3.x preview of vaadin-grid. Upgraded to released version 3.0.2, and now it works OK in IE11/edge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants