Skip to content

Test issue : Local workbench fails when tenant URL is not configured in serve.json #11066

Closed

Description

@Ashlesha-MSFT

Describe the bug
The local workbench starts, but when attempting to load the SharePoint Online workbench, the project does not open against the expected tenant.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new SPFx web part project.
  2. Run heft start.
  3. Select the SharePoint Online workbench.
  4. Observe that the project does not load against the expected tenant.
  5. Expected behavior
  6. automatically configure the tenant URL during project setup,

VS Code Extension Information (please complete the following information):

OS: [e.g. iOS]
Version [e.g. 22]
CLI Information (please complete the following information):
SPFx version 1.23.x
Node.js 22.x
Gulp 4.x

Additional context
] Linting isn't currently supported in watch mode
[build:configure-webpack-serve] Placeholder {tenantdomain} was found in serve.json but OS variable SPFX_SERVE_TENANT_DOMAIN is not set. Either set the environment variable or update the serve.json initial page url.
[build:configure-webpack-serve] Launching initial page: https://{tenantdomain}/_layouts/workbench.aspx?debugManifestsFile=https%3A%2F%2Flocalhost%3A4321%2Ftemp%2Fbuild%2Fmanifests.js&debug=true&noredir=true

Activity

  1. m365-agent-toolkit-assistant commented on Oct 19, 2026

    @m365-agent-toolkit-assistant

    👋 Hi Ashlesha-MSFT,

    Thank you for reporting this issue. Here is an AI-generated initial response:

    Classification: Not a bug — the hosted workbench URL still contains {tenantDomain} because the tenant setting has not been supplied; SPFx does not automatically select a tenant during project setup.

    • The reported warning explicitly says SPFX_SERVE_TENANT_DOMAIN is unset. The local server starting is separate from opening the SharePoint Online workbench.
    • Microsoft’s SPFx setup guidance documents the placeholder and how it is replaced.

    What to do now:

    1. Set SPFX_SERVE_TENANT_DOMAIN to your tenant domain, such as contoso.sharepoint.com, in the environment running heft start; then restart it.
    2. Alternatively, replace initialPage in config/serve.json with your hosted workbench’s full URL. If the URL remains unresolved, share the serve.json value and how you launch Heft.

    Useful links:


    Note: AI-generated guidance may be incomplete or incorrect. Please verify suggestions before applying them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions