2

I am seeking assistance with an issue I've encountered. Within my current setup, I have an LWC component that functions as a screen component within a flow. This flow is called from another LWC component using the Lightning Flow feature. This entire system is hosted within the LWR Experience Cloud site.

While everything appears to function correctly when accessing this component within the Experience Builder, a problem arises once the site is published. Upon attempting to access the component in the published site, the following error emerges:

Something went wrong with the "LWC_Demo" screen component on the "Report Adhoc Hours" flow. Contact your Salesforce admin about this error. LWR3008: Error loading https://demo.develop.my.site.com/volunteers/webruntime/component/latest/prod/en-US/c%2FlookUpWrapper

On examining the Network calls in chrome, I can see the difference between the Experience Builder and the live site are

Experience Builder: https://demo.develop.live-preview.salesforce-experience.com/volunteers/webruntime/component/latest/prod/en-US/c%2FlookUpWrapper

Live Site: https://demo.develop.my.site.com/volunteers/webruntime/component/latest/prod/en-US/c%2FlookUpWrapper

While the component's JavaScript scripts are successfully retrieved and rendered in the live preview, attempting to do so in the published site results in the subsequent detailed error:

GET https://demo.my.site.com/volunteers/webruntime/component/latest/prod/en-US/c%2FlookUpWrapper net::ERR_ABORTED 404 (Not Found)

Refused to execute script from 'https://demo.develop.my.site.com/volunteers/webruntime/component/latest/prod/en-US/c%2FlookUpWrapper' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

I've undertaken the following measures:

  1. Relaxed the CSP setting.
  2. Added the site to CSP trusted sites.
  3. Enabled CORS.
  4. Disabled Lightning Locker.
  5. Exposed the LWC component to communities with the specified targets.
 <apiVersion>57.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__FlowScreen</target>
        <target>lightningCommunity__Page</target>
        <target>lightningCommunity__Default</target>
        <target>lightningCommunity__Page_Layout</target>
    </targets>

What else needed to be checked? I would greatly appreciate any insights or suggestions on resolving this matter.

Note: It was working a while back not sure what has changed resulting in this failure

2

1 Answer 1

1

This happens with LWR Experience Sites, updating the LWC is not properly reflected in the site. To fix this you need to publish the LWR site each time you updated your LWC embedded in flow.

6
  • Hi Damecek, I'm seeing this problem too with a newly created LWR site. I've tried your workaround but with no success. It;s a 404 error for the component that I see. Do you have any other insights on this problem?
    – Keith C
    Commented Jan 24 at 12:16
  • Hi Keith, unfortunately this is the only solution I needed. So I don't have any other insight. You can try fiddle around with the api versions of flow or lwc, that is the only think coming to my mind right now.
    – Damecek
    Commented Jan 25 at 16:13
  • Thanks Damecek - I may try that. I've opened a case and demonstrated the problem so will see if SF come back with anything
    – Keith C
    Commented Jan 25 at 16:50
  • Great, let us know the outcome from sf support.
    – Damecek
    Commented Jan 29 at 10:35
  • 1
    Hi Damecek, will do. Today's update is that it's being worked on.
    – Keith C
    Commented Jan 29 at 10:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .