我在使用JS自定义元素(Web组件)以及在IE11和现代浏览器中支持的stenciljs组件时遇到问题 .

我已经下载了模板启动项目https://github.com/ionic-team/stencil-component-starter并尝试了以下代码:

...
<script src="/build/app.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.1.0/custom-elements-es5-adapter.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.1.0/webcomponents-lite.js"></script>
<script>"custom element written in plain js transpiled to ES5"</script>
...
<body>
<my-app></my-app>
<custom-element></custom-element>
</body>

我在Chrome中收到此错误:

未捕获的TypeError:在新j中没有'new'时无法调用类构造函数(custom-elements-es5-adapter.js:4)

不使用polyfill,它不适用于任何浏览器 .

如何将模板组件与普通JS自定义元素(Web组件)一起使用?