404: Could not find module entry with specifier "lightning/pageReferenceUtils" for sf lightning dev component

Open
#456 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
cli, devtools, frontend

Research direction

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.

Written by the indexing model from the issue text.

Description

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:
  1. Create a new Lightning Web Component named demo
  2. In the component's JavaScript file (demo.js), add the following import statement:
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
  1. 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)"
  ]
}
Dominant language
TypeScript
Stars
19
Forks
19
Avg merge
3d 12h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from salesforcecli/plugin-lightning-dev

All issues in salesforcecli/plugin-lightning-dev

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.