404: Could not find module entry with specifier "lightning/pageReferenceUtils" for sf lightning dev component
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, typescript
调研方向
Start by reproducing the failure with sf lightning dev component --name demo, then trace the module-resolution path shown in the LwrModuleRegistry stack for the lightning-dev plugin. Done means an LWC importing lightning/pageReferenceUtils starts successfully, renders locally, and no longer produces the 404 error.
由索引模型根据 Issue 内容生成。
描述
Summary
When running the local development server for a Lightning Web Component (LWC) that imports from lightning/pageReferenceUtils, the server fails to start and throws a "[error] 404: Could not find module entry with specifier "lightning/pageReferenceUtils"" error. This prevents the local development and testing of any LWC that utilizes this standard Salesforce module, disrupting the development workflow. According to Salesforce documentation, lightning/pageReferenceUtils is intended for use within Lightning Experience. However, for a seamless local development experience, the local development server should support this module.
Steps To Reproduce:
- Create a new Lightning Web Component named demo
- In the component's JavaScript file (demo.js), add the following import statement:
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
- Execute the following command in your terminal to start the local development server:
sf lightning dev component --name demo
Expected Result
The local development server should start successfully without any errors. The demo component should be rendered, and the lightning/pageReferenceUtils module should be correctly resolved, allowing for local development and testing.
Actual Result
The local development server fails to start. The following error is displayed in the terminal, indicating that thelightning/pageReferenceUtils module cannot be found:
Additional Information
Error Log:
❯ sf lightning dev component --name demo
[error] 404: Could not find module entry with specifier "lightning/pageReferenceUtils"
LwrUnresolvableError: 404: Could not find module entry with specifier "lightning/pageReferenceUtils"
at LwrModuleRegistry.delegateGetModuleEntryOnServices (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/module-registry/build/es/index.js:259:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async resolveExternalImport (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/module-registry/build/es/module-record.js:39:35)
at async getModuleRecord (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/module-registry/build/es/module-record.js:81:44)
at async LwrModuleRegistry.createModuleDefinition (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/module-registry/build/es/index.js:133:30)
at async file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/module-registry/build/es/index.js:124:31
at async getModuleGraphs (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/shared-utils/build/es/graph.js:118:11)
at async getHtmlResources (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/view-registry/build/es/linkers/view_bootstrap.js:225:21)
at async file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/view-registry/build/es/linkers/link-lwr-resources.js:13:41
at async linkLwrResources (file:///Users/benjaminloerincz/.local/share/sf/node_modules/@salesforce/plugin-lightning-dev/node_modules/@lwrjs/view-registry/build/es/linkers/link-lwr-resources.js:7:12) {
type: 'module'
}
System Information:
- Operating System: macOS 15.5 (24F74)
- Shell: zsh 5.9 (arm64-apple-darwin24.0)
- Terminal: alacritty 0.15.1 (0c405d5)
- Salesforce CLI Version: @salesforce/cli/2.96.4 darwin-arm64 node-v22.17.0
- @salesforce/plugin-lightning-dev Version: 3.5.0
(The full sf --version --verbose output is included below for detailed plugin information.):
{
"architecture": "darwin-arm64",
"cliVersion": "@salesforce/cli/2.96.4",
"nodeVersion": "node-v22.17.0",
"osVersion": "Darwin 24.5.0",
"rootPath": "/Users/benjaminloerincz/.local/share/sf/client/2.96.4-f8aa88b",
"shell": "zsh",
"pluginVersions": [
"@cristiand391/sf-plugin-fzf-cmp 0.2.0 (user) published 533 days ago (Mon Jan 29 2024)",
"@oclif/plugin-autocomplete 3.2.31 (core)",
"@oclif/plugin-commands 4.1.26 (core)",
"@oclif/plugin-help 6.2.29 (core)",
"@oclif/plugin-not-found 3.2.57 (core)",
"@oclif/plugin-plugins 5.4.43 (core)",
"@oclif/plugin-search 1.2.25 (core)",
"@oclif/plugin-update 4.6.45 (core)",
"@oclif/plugin-version 2.2.30 (core)",
"@oclif/plugin-warn-if-update-available 3.1.42 (core)",
"@oclif/plugin-which 3.2.37 (core)",
"@salesforce/cli 2.96.4 (core)",
"agent 1.23.3 (user) published 2 days ago (Sun Jul 13 2025)",
"apex 3.6.19 (core)",
"api 1.3.3 (core)",
"auth 3.7.4 (core)",
"code-analyzer 5.2.2 (user) published 20 days ago (Tue Jun 24 2025)",
"community 3.3.28 (user) published 30 days ago (Sun Jun 15 2025) (latest is 3.3.31)",
"data 4.0.42 (core)",
"deploy-retrieve 3.22.27 (core)",
"devops-center 1.2.27 (user) published 205 days ago (Sun Dec 22 2024)",
"info 3.4.72 (core)",
"lightning-dev 3.5.0 (user) published 42 days ago (Mon Jun 02 2025) (latest is 2.10.3)",
"limits 3.3.58 (core)",
"marketplace 1.3.8 (core)",
"org 5.9.2 (core)",
"packaging 2.18.0 (user) published 12 days ago (Wed Jul 02 2025)",
"schema 3.3.69 (core)",
"settings 2.4.33 (core)",
"sobject 1.4.63 (core)",
"telemetry 3.6.45 (core)",
"templates 56.3.53 (core)",
"trust 3.7.107 (core)",
"user 3.6.27 (core)",
"@salesforce/sfdx-scanner 4.12.0 (user) published 76 days ago (Tue Apr 29 2025)",
"lightning-flow-scanner 3.27.0 (user) published 1 days ago (Mon Jul 14 2025)",
"sfdmu 4.38.0 (user) published 198 days ago (Sun Dec 29 2024)",
"sfdx-essentials 2.12.0 (user) published 1308 days ago (Tue Dec 14 2021)",
"sfdx-git-delta 6.16.0 (user) published 6 days ago (Tue Jul 08 2025)",
"sfdx-hardis 5.44.0 (user) published 15 days ago (Sun Jun 29 2025)",
"texei-sfdx-plugin 2.8.3 (user) published 126 days ago (Mon Mar 10 2025)"
]
}
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 19
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
salesforcecli/plugin-lightning-dev 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
salesforcecli/plugin-lightning-dev#686 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
salesforcecli/plugin-lightning-dev#627 · 2 条评论 · 1 个 reaction ·
-
BUG P2
难度 3/5 1-2 天 新手友好度 45/100
salesforcecli/plugin-lightning-dev#544 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 45/100
salesforcecli/plugin-lightning-dev#428 · 2 个 reaction ·
查看 salesforcecli/plugin-lightning-dev 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
area:tools bug good first issue help wanted priority:P2
难度 2/5 1-3 小时 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 条评论 ·