Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Dev server fails unrecoverable, if LWC is rendered that recursively references itself

オープン
#250 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
devtools

調査の方向性

Reproduce the failure with sf lightning dev app -t desktop using the recursive c-drag-drop-tree-branch example, and compare it with the normal renderer. Trace the generated tmpl error to the dev-server handling of self-referencing LWCs; done means the dev server renders the recursive tree successfully.

索引モデルが issue の本文から書いたものです。

説明

Summary

The dev server fails to render, if it tries to display an LWC that recursively references itself.

Sorry if the bug report is incomplete and misses relevant information. It's my first bug report. I am very happy to help investigation & debugging.

Steps To Reproduce:

A simple tree implementation

<!-- c-drag-drop-tree-branch -->
<template>
    <div class="draggable-card slds-var-m-vertical_small">
        <lightning-formatted-text value={nodeName}></lightning-formatted-text>
        <template if:true={hasChildren}>
            <template for:each={children} for:item="item">
                <div
                    key={item.id}
                    class="slds-var-m-left_medium slds-var-m-vertical_small"
                >
                    <c-drag-drop-tree-branch
                        data-id={item.id}
                        role="treebranch"
                        branch-data={item}
                        is-root="false"
                        draggable
                    ></c-drag-drop-tree-branch>
                </div>
            </template>
        </template>
    </div>
</template>
Expected Result

The dev-server renders the LWC correctly and shows the same result as the "normal" (?) renderer.

When the source is pushed LWC dev server is off, it renders the tree recursively

image
Actual Result

When dev server is launched (sf lightning dev app -t desktop), it throws this error

function tmpl($api, $cmp, $slotset, $ctx) {
      const {c: api_custom_element, k: api_key, h: api_element, i: api_iterator, f: api_flatten} = $api;
      return [api_element("div", stc0, api_flatten([api_custom_element("lightning-formatted-text", _lightningFormattedText__default.default, {
        props: {
          "value": $cmp.nodeName
        },
        key: 1
      }), $cmp.hasChildren ? api_iterator($cmp.children, function (item) {
        return api_element("div", {
          classMap: stc1,
          key: api_key(2, item.id)
        }, [api_custom_element("c-drag-drop-tree-branch", _cDragDropTreeBranch, {
          attrs: {
            "data-id": item.id
          },
          props: {
            "role": "treebranch",
            "branchData": item,
            "isRoot": "false",
            "draggable": true
          },
          key: 3
        })]);
      }) : stc2]))];
      /*LWC compiler v7.1.3*/
    } is not a valid component, or does not extends LightningElement from "lwc". You probably forgot to add the extend clause on the class declaration.
Additional Information

Screenshots:

Logs:

System Information

SF CLI:

@j-schreiber/sf-plugin 0.1.2
@tmh-bis-salesforce/tmh-bis-salesforce-cli-plugin 0.8.3
community 3.3.2 (3.3.2)
dev 2.5.0 (2.5.0)
lightning-dev 1.9.3
packaging 2.9.0
sfdmu 4.36.7
texei-sfdx-plugin 2.8.1

Uninstalled JIT Plugins:
custom-metadata 3.3.36
devops-center 1.2.25
env 3.0.33
functions 1.23.0
signups 2.5.23
@salesforce/sfdx-plugin-lwc-test 1.2.1
@salesforce/sfdx-scanner 4.7.0
主要言語
TypeScript
スター
19
フォーク
19
平均マージ
3日 12時間
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

salesforcecli/plugin-lightning-dev のほかの issue

salesforcecli/plugin-lightning-dev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。