salesforcecli/plugin-lightning-dev

lightning-dev 1.1.0 - get 404 error on loading lwr js files with "sf lightning dev site"

Closed this issue ยท 7 comments

Note
Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

Hello, I wanted to try the new beta plugin "local dev" for the development for a new LWR experience cloud. So I tried to setup my project to make it works:

  • I checked the "Local Dev" on my sandbox.
  • I added some missing @lwrjs depedencies to my package.json:
    image
  • I encountered a first problem with the lwc engine, I correct it (maybe wrongly) by updating the "LWC_VERSION" inside the "\app\site\dev\mrt******@lwc\engine-server.js" file generated by "sf lightning dev site":
    image
  • Now, I have a 404 error on all lwr js files, I don't know why it looks for files on "/mobify/bundle/development/.localdev/..." and not directly on "/.localdev/...":
    image

Steps To Reproduce

  • run sf lightning dev site on a new LWR experience

Expected result

No more 404 errors on lwr js files fetched

Actual result

No errors on screen but errors on the browser dev console.

image

Additional information

System Information

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.56.7",
  "nodeVersion": "node-v20.10.0",
  "osVersion": "Windows_NT 10.0.19045",
  "rootPath": "C:\\Users\\*******\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
  "shell": "powershell",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.0 (core)",
    "@oclif/plugin-commands 4.0.11 (core)",
    "@oclif/plugin-help 6.2.8 (core)",
    "@oclif/plugin-not-found 3.2.16 (core)",
    "@oclif/plugin-plugins 5.4.4 (core)",
    "@oclif/plugin-search 1.2.5 (core)",
    "@oclif/plugin-update 4.5.3 (core)",
    "@oclif/plugin-version 2.2.10 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.11 (core)",
    "@oclif/plugin-which 3.2.10 (core)",
    "@salesforce/cli 2.56.7 (core)",
    "apex 3.4.2 (core)",
    "api 1.1.0 (core)",
    "auth 3.6.48 (core)",
    "community 3.2.29 (user) published 3 days ago (Sat Aug 31 2024)",
    "data 3.6.1 (core)",
    "deploy-retrieve 3.10.1 (core)",
    "info 3.3.29 (core)",
    "lightning-dev 1.1.0 (user) published 16 days ago (Sun Aug 18 2024)",
    "limits 3.3.25 (core)",
    "marketplace 1.2.22 (core)",
    "org 4.5.4 (core)",
    "packaging 2.8.0 (core)",
    "schema 3.3.24 (core)",
    "settings 2.3.13 (core)",
    "signups 2.5.9 (user) published 16 days ago (Sun Aug 18 2024) (latest is 2.5.12)",
    "sobject 1.4.29 (core)",
    "source 3.5.14 (core)",
    "telemetry 3.6.7 (core)",
    "templates 56.3.12 (core)",
    "trust 3.7.23 (core)",
    "user 3.5.25 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.2.0 (user) published 181 days ago (Tue Mar 05 2024)",
    "@salesforce/sfdx-scanner 4.2.0 (user) published 97 days ago (Tue May 28 2024) (latest is 4.5.0)"
  ]
}

@Ewaken thanks for filing this issue - we are working on having a fix out sometime tomorrow.

@Ewaken - should be resolved in v1.2.0 if you want to give that a try

Hello,
Seems like issue has been resolved.
But unable to load the site.
After updating to the v1.2.0 getting the following errors

  1. rendering for "webruntime/appXk3ja79" failed. Reason: 404: Could not find module with specifier "lightning/alert"
  2. Uncaught TypeError: LWR.define is not a function

It is a Custome LWR Site

@lakshmakusam - could you file a new issue with more details please?

@nrkruk Created new issue #178

Hello @nrkruk I still have the same issue with 1.2.0 version:
image

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.58.7",
  "nodeVersion": "node-v20.10.0",
  "osVersion": "Windows_NT 10.0.19045",
  "rootPath": "C:\\Users\\******\\AppData\\Roaming\\npm\\node_modules\\@salesforce\\cli",
  "shell": "powershell",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.2 (core)",
    "@oclif/plugin-commands 4.0.13 (core)",
    "@oclif/plugin-help 6.2.10 (core)",
    "@oclif/plugin-not-found 3.2.18 (core)",
    "@oclif/plugin-plugins 5.4.6 (core)",
    "@oclif/plugin-search 1.2.7 (core)",
    "@oclif/plugin-update 4.5.5 (core)",
    "@oclif/plugin-version 2.2.11 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.13 (core)",
    "@oclif/plugin-which 3.2.12 (core)",
    "@salesforce/cli 2.58.7 (core)",
    "apex 3.4.8 (core)",
    "api 1.2.1 (core)",
    "auth 3.6.54 (core)",
    "community 3.2.32 (user) published 5 days ago (Sat Sep 14 2024)",
    "data 3.6.5 (core)",
    "deploy-retrieve 3.12.3 (core)",
    "info 3.4.3 (core)",
    "lightning-dev 1.2.0 (user) published 6 days ago (Sat Sep 14 2024)",
    "limits 3.3.29 (core)",
    "marketplace 1.2.25 (core)",
    "org 4.5.7 (core)",
    "packaging 2.8.2 (core)",
    "schema 3.3.26 (core)",
    "settings 2.3.16 (core)",
    "signups 2.5.12 (user) published 19 days ago (Sun Sep 01 2024) (latest is 2.5.16)",
    "sobject 1.4.33 (core)",
    "source 3.5.18 (core)",
    "telemetry 3.6.10 (core)",
    "templates 56.3.17 (core)",
    "trust 3.7.27 (core)",
    "user 3.5.29 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.2.0 (user) published 198 days ago (Tue Mar 05 2024)",
    "@salesforce/sfdx-scanner 4.2.0 (user) published 114 days ago (Tue May 28 2024) (latest is 4.5.0)"
  ]
}

Hello @nrkruk fixed with 1.3.0 version. Thank you. ๐Ÿ˜ƒ