【发布时间】:2019-12-29 07:31:19
【问题描述】:
使用最新的注册自定义元素时未捕获的承诺 sapper、svelte、nodeJS 和 rollup 堆栈使用以下 声明。
REPL 示例:https://svelte.dev/repl/489ee8acd10848b0bb1feb2535bd6cc5?version=3.16.5 在本地创建
<svelte:options tag="parlax-background" />
& rollup.config.js
export default {
client: {
input: config.client.input(),
output: config.client.output(),
plugins: [
replace({...})
svelte({
dev: !production,
customElement: true,
// and tried also with customElement: { tag: "my-element"}
hydratable: true,
emitCss: true
我想提一下我在一个新项目上进行了测试
日志
[Client Side]
=> Uncaught (in promise) TypeError: Illegal constructor
at new SvelteElement (index.mjs:1381)
[Server Side]
=> The 'tag' option is used when generating a custom element. Did you forget the 'customElement: true' compile option?
44: <svelte:options tag="my-element" />
1.当我在配置中注册 [ **customElement: true ] 时,我得到**
2。如果我没有在配置中注册我的元素,我不会收到任何错误,但我的元素都没有注册 :(
【问题讨论】:
标签: custom-element rollup svelte rollupjs sapper