Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

#LWC Local Development1 discussing

LWC Local Development-related issues. It covers, installations, Web Component creation using LWC Dev server, Webcomponents.dev environment online and offline.
Rene Plowden posted in LWC

Local dev beta findings

 

When using local dev (beta) your page will fail to compile if your LWC component has a nested folder containing helper js methods.  The issue can be avoided by placing helper js methods in the root directory but I thought it was worth noting since having a nested folder structure with helper methods is allowed when developing and deploying.  For example, I have a testComponent LWC which imports a helper js method which contains static json files from a nested  "data" folder. The presence of testComponent/data/helper.js will result in the page containing the LWC to file to compile with an error:

 

500: Unexpected error fetching "/testComponent": An unexpected error occurred: "ENOENT%3A%20no%20such%20file%20or%20directory5Cforce-app%5Cmain%5Cdefault%5Clwc%testComponent%5Cdata%5ChelperMethod%27"

 

Similarly, if you have an LWC which only contains a .css file, a similar error will occur (requires the js file to be present).  Again probably not a standard pattern, but it is functional and allowable by the platform normally.

 

#LWC Local Development

0/9000
Rene Plowden asked in LWC

Warning: could not establish valid auth token for your site 'Business Owner Experience'.Local Dev proxied requests to your site may fail or return data from the guest user context.

 

I'm receiving the above warning intermittently when experimenting with the new LWC local dev beta.  I don't always get the warning, and I believe my admin user I develop with was being used by default since I can view pages that will otherwise redirect if you're a guest user. How can I prevent this from occurring?

 

Side note: Is there a way to provide an auth token for a different user persona than the one we use to oauth connect to the org? For example an Experience Cloud Site community user?

 

#LWC Local Development

0/9000

Learn More About: LWC Local Dev  

 

The beta of LWC Local Dev was one of the biggest announcements for developers at #Dreamforce2024. With Local Dev you can get a preview of your components just by saving your code, which makes you a much more productive developer. 

 

This means that you can save 3-10 seconds of wait time per component update, and when you spend days working on an #LWC development, this quickly adds up to hours saved.

 

Local Dev works across various Salesforce containers, such as Lightning Experience, #LWR sites for @* Experience Cloud *, and the Salesforce mobile app.

 

To learn more about this feature and how it works behind the scenes, check out these great resources from Developer Advocate @Alba Rivas:

📽 Watch a video

📖 Read a blog

 

If you have feedback or questions about Local Dev, post them in the @LWC group, using #LWC Local Development tag.

Learn More About: LWC Local Dev The beta of LWC Local Dev was one of the biggest announcements for developers at .

3 comments
0/9000