-
Notifications
You must be signed in to change notification settings - Fork 491
The custom element constructor did not produce the element being upgraded #760
Comments
Update: removing |
Hi @mseddon, I am getting same error, any update on this ? |
@sanjeevpande I'm afraid I haven't got much more on this than the Stack Overflow issue linked above, but there is a workaround posted there. The issue appears to be related to Typescript transpiling classes to ES5 differently from e.g. babel, which seems to cause grief. The 'right' solution (my answer posted there) is to get Typescript to compile to ES6, then transpile down to ES5 with babel, but the accepted answer 'magically' fixes it if you want to take the risk that weird stuff might be happening underneath :) |
Hi @mseddon, the issue is now fixed. The dom-module not loaded fully and the component was referenced in the html before that. This was resulting in this error. By the way, I am using custom-elements-es5-adapter.js with ES5. Thanks. |
This was an upstream issue in TypeScript (microsoft/TypeScript#7574) for which we now have reenabled our tests (webcomponents/custom-elements#151) which assert that ES5-output of TypeScript work correctly (https://github.com/webcomponents/custom-elements/blob/2b63886b2955c10ae7e322fe1ef7b954a13ad11e/tests/js/typescript.js) |
Initially posted on Stack Overflow
I'm running into trouble getting a simple web component to work when transpiled to ES5. It appears to function perfectly fine under Chrome, Edge, and Firefox, but IE11 is failing in the component's constructor with "The custom element constructor did not produce the element being upgraded."
Where have I gone wrong?
The original source (in TypeScript):
The output (
bundle.js
):And my HTML:
The text was updated successfully, but these errors were encountered: