SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Add instructions on replacing {tenantDomain} #9859

Closed darrenw-npi closed 3 months ago

darrenw-npi commented 3 months ago

This page doesn't seem to say anywhere that you need to replace {tenantDomain} in serve.json with your own Sharepoint domain name. This causes confusion when you first run gulp serve as it doesn't open the correct web page. This could cause Developers (especially the beginners who are the likely target audience for this document) to be put off Sharepoint development.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

andrewconnell commented 3 months ago

You aren't supposed to update it... you use the environment variable to let the gulp serve process set it:

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/release-1.17 https://www.voitanos.io/blog/set-spfx-hosted-workbench-test-site/

darrenw-npi commented 3 months ago

You aren't supposed to update it... you use the environment variable to let the gulp serve process set it:

Oh right! Thanks for explaining that. The setup article https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment probably needs updating then

darrenw-npi commented 3 months ago

Accidentally closed this. I'll submit a new PR for that

andrewconnell commented 3 months ago

When I saw your PR & issue, I went looking & was surprised it wasn't in the setup... so I already too care of it in #9867

I'm going to reclose this.

darrenw-npi commented 3 months ago

Out of interest the warning message when you run gulp serve says "Warning - [spfx-serve] Placeholder {tenantDomain} was found in server.json but OS variable SPFX_SERVE_TENANT_DOMAIN is not set. Either set the environment variable or update the serve.json initial page url."

I'm guessing it gives the option of updating serve.json in case you work with mutliple tenant domains? - like a freelancer might do for example. Also note that there is a typo as it references server.json instead of serve.json near the start of the sentence.

andrewconnell commented 3 months ago

Sure... you can change serve.json if you want to, but this would get checked into source control. This way, each developer on a team can have their own unique dev environment without having to update the repo..