salesforcecli / plugin-lightning-dev

Local development tools for LEX, Mobile, and Experience Sites
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

Namespace Issue When Trying to Preview LWCs #212

Open RobertMirandola opened 2 hours ago

RobertMirandola commented 2 hours ago

Summary

When working on a scratch org, any source code edits to an LWC are not being reflected due to a namespace mismatch issue.

Steps To Reproduce:

  1. In a scratch org project, run sf lightning dev app
  2. In code editor, make a change to an LWC.

Expected Result

The change in the code editor should have resulted in a change on the browser.

Actual Result

Nothing happened

Additional Information

Screenshots:

Screenshot 2024-10-22 at 2 05 11 PM Screenshot 2024-10-22 at 2 05 28 PM

^Notice the namespace mismatch in data[0].modulePath vs what the namespace is within the component that is trying to be registered ("c/gaugeHome/gaugeHome.html" vs 'cstoolkit/gaugeHome/gaugeHome.css').

Here are the contents of my sfdx-project.json:

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true,
      "package": "Gauge",
      "versionName": "ver 4.6.0",
      "versionNumber": "4.6.0.NEXT",
      "ancestorVersion": "4.5.0"
    }
  ],
  "namespace": "cstoolkit",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "53.0",
  "packageAliases": {
    "Gauge": "0Ho8Y0000004CFRSA2"
  }
}

Logs:

System Information

SF CLI:

PASTE_SF_VERSION_OUTPUT_HERE

OS:

Experience Sites Only:

PASTE_runtime-info.json_HERE
ravijayaramappa commented 2 hours ago

@RobertMirandola Can you please attach the content of your sfdx-project.json file as well?

git2gus[bot] commented 2 hours ago

This issue has been linked to a new work item: W-17041153

RobertMirandola commented 2 hours ago

@RobertMirandola Can you please attach the content of your sfdx-project.json file as well?

Done!