Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[Bug] Local Play always fails with "Code app URL is not available" when EnableAuthenticatedGateway feature gate is on

未關閉
#504 1 則留言 1 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@jiankai82 已經在處理了。

開始於 2026年10月20日。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
node.js, react, typescript, vite
領域
frontend, web-dev

研究方向

Start by reproducing Local Play with the reported versions of @microsoft/power-apps and @microsoft/power-apps-vite, then inspect the player boot path and environment API request associated with the 403. Compare the local player flow with pac code push to locate where the code app URL becomes unavailable. Done means identifying the cause and restoring Local Play or documenting a supported workaround; the issue does not name repository files or tests.

由索引模型根據 Issue 內容生成。

描述

bug

Summary

Local Play for code apps stopped working for us around 20 Oct 2026. The player stays blank and throws AppLoadFailed — Code app URL is not available. The published app works normally.

Microsoft's web player has started sending the feature gate "EnableAuthenticatedGateway": true. With that gate on, the player ignores the local dev server address, so the /a/local Local Play link can't load.

Steps to reproduce

  1. Run npm run dev with @microsoft/power-apps-vite.
  2. Open the Local Play link it prints:
    https://apps.powerapps.com/play/e/<environment-id>/a/local?_localAppUrl=http://localhost:5173/&_localConnectionUrl=http://localhost:5173/__vite_powerapps_plugin__/power.config.json
  3. The page stays blank.

Actual behavior

Uncaught (in promise) {code: 'AppLoadFailed', source: 'host', message: 'Code app URL is not available', errorType: 'PlatformError'}
  at getAppFrameUrlAsync / _loadAppAsync (es6.player-boot.js)

In the Network tab:

  • localhost:5173/__vite_powerapps_plugin__/power.config.json loads fine (preflight 204, GET 200).
  • The app itself (localhost:5173/) is never requested.
  • GET …/powerapps/apps/local/permissions returns 403 ("user … does not have permission to access this"). For the same user, GET …/powerapps/apps/<appId>/permissions returns 200 (Owner).

Expected behavior

The app loads from the local dev server, as it did before.

Cause (from reading es6.player-boot.js)

window.webPlayerServerConfig.FeatureGates now contains "EnableAuthenticatedGateway": true.

In CodeAppLoader._getAppUriAsync, when _enableAuthenticatedGateway is true:

  • the preloadMetadata.codeAppPackage branch (which carries _localAppUrl) is skipped
  • only listAppPackageOperationDetails.appPackageDetails.authenticatedCodeAppPackage is used

For /a/local there is no published package, so it returns nothing and getAppFrameUrlAsync throws "Code app URL is not available".

Workaround

Append this to the Local Play URL:

&PAOverrideFGRollout.EnableAuthenticatedGateway=false

With it, Local Play loads and hot reload works again.

What we ruled out

  • Our code: fails the same on an older commit that previously worked.
  • SDK version: same result on @microsoft/power-apps 1.1.3 + power-apps-vite 1.0.2 and on 1.5.0 + 1.0.13.
  • Browser and device: same in Chrome, Edge and Incognito, and on a separate personal device.
  • Permissions: the user is System Administrator in the environment and Owner of the app, and "Enable code apps" is On.

Environment

  • @microsoft/power-apps 1.1.3 (also tested 1.5.0), @microsoft/power-apps-vite 1.0.2 (also tested 1.0.13)
  • Vite 7.3.3, React 19, Node.js 24, Windows 11
  • Chrome 155 / Edge, player PowerApps/3.26103.18
  • Region: Australia
  • Data sources: Dataverse, plus Office 365 Users, SharePoint Online and one custom connector

Request

Please make Local Play work with EnableAuthenticatedGateway on: use _localAppUrl for /a/local. Alternatively, have @microsoft/power-apps-vite print a Local Play URL that works with the gateway.

主要語言
TypeScript
星號
516
分支
145
平均合併
1 天 10 小時
30 天內合併 PR
23

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/PowerAppsCodeApps 的其他 Issue

查看 microsoft/PowerAppsCodeApps 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。