Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Live-Reload Fails to Update Child Components with Dynamic Imports in Salesforce LocalDev for Experience Sites

未关闭
#231 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@nrkruk 已经在做这个了。

开始于 2024年11月8日。

评估

这个 Issue 还没有评估数据。

描述

BUG P3
Summary

Live-reload functionality in Salesforce LocalDev does not refresh child components when the main component published to an Experience Website uses dynamic imports. Specifically, if a component is dynamically imported (e.g., import('c/dynamicComponent')), any changes made to the dynamically imported child component (or any other non-dynamically imported child component) are not recompiled or published as expected during live-reload.

Steps To Reproduce:
  1. Set up a main component (WebsiteMain) that dynamically imports child components using import('c/childComponent').

  2. Publish the main component to an Experience Website and initiate live reload using the command:
    sf lightning dev site --target-org dev --name "MyWebsite"

  3. Make a change to the dynamically imported child component, or any other child component (e.g., childComponent).

  4. Observe that live reload does not pick up changes made to any child component.

Expected Result

When a change is made to any child component and the parent utilizes a dynamically imported component, live-reload should refresh and apply the changes across all relevant components, including any dynamically imported child components.

Actual Result

Live-reload does not detect or apply changes made to any child components other than the main component that utilizes the main site. All child components (even those that are not dynamically imported) appear to remain unaffected by these changes during live-reload.

Additional Information

Code Sample
Here’s an example of the WebsiteMain component, illustrating the dynamic import setup:

import { CurrentPageReference } from 'lightning/navigation';
import { LightningElement, track, wire } from 'lwc';

export default class WebsiteMain extends LightningElement {
    @track currentPage = null; // Current page's object
    @track dynamicComponent = null; // Holds the dynamically imported component constructor

    myDynamicPages = [
        {
            id: 1,
            name: "Basic Information",
            path: "BasicInformation",
            component: () => import('c/childComponent'),
            showPageNavbar: false
        }, ...
    ];
}

    async loadComponent(page) {
        const componentModule = await page.component();
        this.dynamicComponent = componentModule.default;
    }

Screenshots:

None

Logs:

No logs are created (even when DEBUG=* is set) when modifying a child component with dynamic imports utilized.

System Information

SF CLI:

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.63.8",
  "nodeVersion": "node-v20.17.0",
  "osVersion": "Windows_NT 10.0.22635",
  "rootPath": "C:\\Users\\BradyNadeau\\AppData\\Local\\sf\\client\\2.63.8-fbf82e0",
  "shell": "cmd.exe",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.6 (core)",
    "@oclif/plugin-commands 4.1.3 (core)",
    "@oclif/plugin-help 6.2.15 (core)",
    "@oclif/plugin-not-found 3.2.22 (core)",
    "@oclif/plugin-plugins 5.4.15 (core)",
    "@oclif/plugin-search 1.2.12 (core)",
    "@oclif/plugin-update 4.6.4 (core)",
    "@oclif/plugin-version 2.2.15 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.19 (core)",
    "@oclif/plugin-which 3.2.16 (core)",
    "@salesforce/cli 2.63.8 (core)",
    "apex 3.5.4 (core)",
    "api 1.3.1 (core)",
    "auth 3.6.68 (core)",
    "data 3.7.1 (core)",
    "deploy-retrieve 3.15.3 (core)",
    "info 3.4.12 (core)",
    "lightning-dev 1.9.0 (user) published 19 days ago (Fri Oct 11 2024)",
    "limits 3.3.33 (core)",
    "marketplace 1.2.26 (core)",
    "org 4.7.0 (core)",
    "packaging 2.8.12 (core)",
    "schema 3.3.36 (core)",
    "settings 2.3.24 (core)",
    "signups 2.5.23 (user) published 17 days ago (Sat Oct 12 2024)",
    "sobject 1.4.42 (core)",
    "source 3.5.21 (core)",
    "telemetry 3.6.16 (core)",
    "templates 56.3.24 (core)",
    "trust 3.7.34 (core)",
    "user 3.5.33 (core)"
  ]
}

OS:

Experience Sites Only:

{
  "orgId": "00D7X000000URjZ",
  "siteId": "0DMOt0000004igo",
  "clwrVersion": "252.131",
  "coreVersion": "252.11",
  "coreChangelist": "49784824",
  "bundleGenerationDate": "Oct 30, 2024 10:47:36 PM",
  "siteTemplateName": "talon-template-byo",
  "deployTarget": "CORE"
}
主要语言
TypeScript
星标
19
派生
19
平均合并
3 天 12 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

salesforcecli/plugin-lightning-dev 的其他 Issue

查看 salesforcecli/plugin-lightning-dev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。