[SalesForce] Unable to create scratch org successfully in Visual Studio Code

I have authorized dev hub org successfully and now trying to create default scratch org using visual studio code but getting following error:

sfdx force:org:create -f config\project-scratch-def.json --setalias LightningWebComponent --setdefaultusername

ERROR running force:org:create: Successfully created org with ID:
00DN0000000CgnWMAS and name: test-uuplqwe9abid@example.com. However,
the My Domain URL
https://innovation-ability-7287-dev-ed.cs6.my.salesforce.com/ has not
finished propagating.

Some commands may not work as expected until the
My Domain DNS propagation is complete.

sfdx force:org:create -f
config\project-scratch-def.json –setalias LightningWebComponent
–setdefaultusername ended with exit code 1

Best Answer

This is not really an error. You just need to wait a few more minutes for the Domain Name to be propagated.

Just try to open the org with sfdx force:org:open later, and it will work.

If you want the command to exit with a non error exit code, you can just increase the timeout using the --wait flag, so that the DNS has the time to propagate:

sfdx force:org:create -f config\project-scratch-def.json --setalias LightningWebComponent --setdefaultusername --wait 30

Most likely, if you just retry to create a scratch org as is it will just work.

Related Topic