From a3a93f250b3b4ca9aa04b0cf7dd6c097f9b8c414 Mon Sep 17 00:00:00 2001 From: Amin Ya Date: Thu, 12 Mar 2026 21:51:33 -0700 Subject: [PATCH] fix: fix web sideload with manifest preview To side load on the web, the sourceLocation is required, however, the dev manifest preview fails if you add it in the manifest file. This adds a default location, so that web side load works with the manifest preview --- packages/office-addin-dev-settings/src/sideload.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/office-addin-dev-settings/src/sideload.ts b/packages/office-addin-dev-settings/src/sideload.ts index 443cfe21b..bb0ff0658 100644 --- a/packages/office-addin-dev-settings/src/sideload.ts +++ b/packages/office-addin-dev-settings/src/sideload.ts @@ -135,13 +135,9 @@ export async function generateSideloadUrl( if (!manifest.id) { throw new ExpectedError("The manifest does not contain the id for the add-in."); } - - if ( - manifest.defaultSettings === undefined || - manifest.defaultSettings.sourceLocation === undefined - ) { - throw new ExpectedError("The manifest does not contain the SourceLocation for the add-in"); - } + + manifest.defaultSettings = manifest.defaultSettings ?? {}; + manifest.defaultSettings.sourceLocation = manifest.defaultSettings.sourceLocation ?? "https://localhost:4000"; const sourceLocationUrl: URL = new URL(manifest.defaultSettings.sourceLocation); if (sourceLocationUrl.protocol.indexOf("https") === -1) {