Lightning Web Components – Workaround for LWR3008 Error (404 Status) in LWR Site

digital-experienceflow-screen-componentlightning-web-componentslightning-web-runtimescreen-flow

Support for flows in an LWR site that can contain LWCs was announced in Summer '22. But right now, I can't get that to work, and see a 404 status on the GET of the first LWC embedded in the flow:

https://abc-def-9876-dev-ed.scratch.my.site.com
/MYSITE/webruntime/component/latest/dev/en-US/myNs%2FmyComponent

with this message reported:

Something went wrong with the "MyComponent" screen component on the "My Flow" flow. Contact your Salesforce admin about this error. LWR3008: Error loading https://abc-def-9876-dev-ed.scratch.my.site.com/MYSITE/webruntime/component/latest/dev/en-US/myNs%2FmyComponent

The site:

  • was setup using sf community create --name MYSITE --template-name 'Build Your Own (LWR)' --url-path-prefix MYSITE templateParams.AuthenticationType=AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED
  • appears to be an Enhanced LWR Site
  • has non-flow LWCs working correctly
  • is using 100% LWC components already working in an older Aura template site

The same problem has been reported in these places with no accepted answer posted:

Two questions:

  • Q1: Is there a work-around for this problem?
  • Q2: Does this work at all for you e.g. with no namespaces and no packaging involved?

(I opened a case #46129847 with Salesforce but that did not get me very far.)

Best Answer

Looks like the cause of my problem is that instead of directly using the flow component I have an LWC (wrapped-flow) wrapping the lightning-flow to improve the startup behaviour e.g. spinner over a card.

If both of these are in the experience page both work. If only flow is in the page it works. If only wrapped-flow is in the page I get the LWR-3008 error. Pretty weird.

On the general areas of "no Aura", this Flows Work with Experience LWR Sites (and why “Navigate Everywhere” and “Open URL” Don’t Work There Yet) explains that some LWC components still layer on top of Aura. So, for example, a LWC that I have that uses lightning-file-upload doesn't render anything for that lightning-file-upload or after that. So somewhat open ended "gotchas" possible.

Related Topic