小编ncl*_*iuf的帖子

Uncaught (in promise) TypeError: Illegal constructor at new SvelteElement (index.mjs:1381)

使用以下语句使用最新的 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
Run Code Online (Sandbox Code Playgroud)

我想提一下,我已经在一个新项目上进行了测试

日志

[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 …
Run Code Online (Sandbox Code Playgroud)

rollup custom-element rollupjs svelte sapper

5
推荐指数
1
解决办法
1398
查看次数

标签 统计

custom-element ×1

rollup ×1

rollupjs ×1

sapper ×1

svelte ×1