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:
- 11 months ago "LWR3008: Error" from LWC component in Flow on a digital experiences page
- 6 months ago Receiving "LWR3008" error while accessing a LWC screen flow component in LWR sites
- 3 months ago Receiving "LWR3008" error while accessing a LWC screen flow component in LWR sites
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 thelightning-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 onlywrapped-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 thatlightning-file-upload
or after that. So somewhat open ended "gotchas" possible.