salesforcecli / plugin-lightning-dev

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

rendering for "webruntime/appXk3ja79" failed. Reason: 404 when using the plugin #178

Open lakshmakusam opened 2 months ago

lakshmakusam commented 2 months ago

Summary

Unable to use the plugin with the custom LWR Site.

Steps To Reproduce:

  1. Upgrade/install version v1.2.0
  2. Try to run command sf lightning dev site -n sitename (replace sitename with your site)
  3. Open the browser inspect element

Expected Result

Site to open in a browser tab

Actual Result

Following errors are shown

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

Additional Information

System Information

SF CLI:

Terminal : zsh OS: MacOS Sequoia

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.57.7",
  "nodeVersion": "node-v20.16.0",
  "osVersion": "Darwin 24.0.0",
  "rootPath": "/Users/lakshma.kusam/.local/share/sf/client/2.57.7-291554e",
  "shell": "zsh",
  "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.57.7 (core)",
    "apex 3.4.5 (core)",
    "api 1.2.1 (core)",
    "auth 3.6.51 (core)",
    "data 3.6.3 (core)",
    "deploy-retrieve 3.12.0 (core)",
    "info 3.4.2 (core)",
    "lightning-dev 1.2.0 (user) published 5 days ago (Fri Sep 13 2024)",
    "limits 3.3.27 (core)",
    "marketplace 1.2.24 (core)",
    "org 4.5.4 (core)",
    "packaging 2.8.0 (core)",
    "schema 3.3.26 (core)",
    "settings 2.3.15 (core)",
    "sobject 1.4.32 (core)",
    "source 3.5.16 (core)",
    "telemetry 3.6.10 (core)",
    "templates 56.3.14 (core)",
    "trust 3.7.25 (core)",
    "user 3.5.26 (core)",
    "sfdmu 4.36.0 (user) published 11 days ago (Sat Sep 07 2024)"
  ]
}

OS: MacOS Sequoia

nrkruk commented 2 months ago

@lakshmakusam can you share the contents of the file in your sfdx project --> .localdev/${sitename}/app/site/.metadata/runtime-info.json

lakshmakusam commented 2 months ago
{
  "orgId": "XXXXX",
  "siteId": "XXXXXX",
  "clwrVersion": "252.117",
  "coreVersion": "252.4",
  "coreChangelist": "48647231",
  "bundleGenerationDate": "Sep 5, 2024 7:52:51 PM",
  "siteTemplateName": "talon-template-byo"
}

@nrkruk Please let me know you need the orgId or the siteId

nrkruk commented 2 months ago

@lakshmakusam Looks like your site was published before the latest patch release (252.5) which contains local-dev related fixes. Can you try publishing your site again and then re-running the local dev command? (local-dev will then prompt you to download the newly published site and set that up)

lakshmakusam commented 2 months ago

Thank you, that worked.

But unfortunately running into weird issue where the LWC isn't rendering or debugging is hitting the LWC constructor

When I tried the published site, everything is rendering as expected

Published site :

Screenshot 2024-09-19 at 1 18 17 PM

Local Dev Site:

Screenshot 2024-09-19 at 1 18 55 PM

Both have the same URL parameters, and the Site is published to the root

nrkruk commented 2 months ago

@lakshmakusam could you send me a screen grab of network requests tab from the chrome developer tools? Any console errors you are getting (browser and dev server)?

lakshmakusam commented 2 months ago

Here is the Network tab.

Screenshot 2024-09-20 at 9 29 08 AM
nrkruk commented 2 months ago

There are no errors in the browser console or in the server logs? Can you try clearing your browser cache? Another thing you could also try is updating plugin-lightning-dev to the latest version (1.3.0). If for some reason this is authentication related, that could help.

If you are comfortable, feel free to privately share your site zip with me and I can debug further (Site zip is located at: .localdev/{sitename}/{sitename}.gz)