I was trying to use local development in lwc (lightning web components) but I found that I can't access the org data because of cors. I try to add my local URL (http: that lwc services generate for me when I run (npm start watch). But my org does not accept http url, only https, so the question is, how can I start my local server on https so I can add my URL to my Whitelisted Origins on my org? Thank you!

  • How to setup this local development? Is there any documentation related to his? @sebas – ajinkyah Jul 26 '19 at 7:13
  • @ajinkyah Hi! Here it is all the doc: lwc.dev – Sebas Belaustegui Jul 29 '19 at 12:21
  • This website is for LWC Open Source, right? Is this the same as Local Development for LWC which was presented in TrailheadDX? – ajinkyah Aug 8 '19 at 8:52
  • @ajinkyah that's right! – Sebas Belaustegui Aug 9 '19 at 12:37
  • 1
    Right Joe. I have seen this. Local development will be supported with a sfdx command and is intended for local development of the components for Salesforce org which is not the case with LWC open source. People are mixing these two and considering the two to be same. – ajinkyah Aug 28 '19 at 6:14

You can whitelist http://localhost:3001 - localhost is an allowed exception

  • For anyone that try this solution, when you start the server with 'npm run watch' the url it is but you can also use localhost, it works. Thanks @Renji-xD – Sebas Belaustegui Jun 18 '19 at 13:52

When you want to launch watch mode with HTTPS you can pass a custom webpack.config.js using the -w flag that will enable the https option in webpack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.