Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug] Local Play fails with AppLoadFailed "Code app URL is not available" (403 on environment API); published app works

Đang mở
#504 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, react, typescript, vite
Lĩnh vực
frontend, web-dev

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug

Local Play for an existing code app stopped loading without any change to the project. The player stays blank and throws AppLoadFailed with the message "Code app URL is not available". The same app works normally once published with pac code push.

The Vite dev server is running and serves both the app and the connection config. The player fails before any request reaches localhost. Just before the error, the player gets a 403 from the environment API.

Steps to reproduce

  1. npm run dev (Vite + @microsoft/power-apps-vite)
  2. Open the printed Local Play URL:
    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 and the console shows the errors below.

Expected behavior

The app loads in the local player, as it did before with the same code and setup.

Actual behavior

Console (trimmed):

es6.player-boot.js:1225 Uncaught (in promise) {code: 'AppLoadFailed', source: 'host', message: 'Code app URL is not available', details: undefined, errorType: 'PlatformError', …}
  _loadAppAsync @ es6.player-boot.js:1228
  playAppAsync  @ es6.player-boot.js:1228

GET https://<id>.environment.api.powerplatform.com/...?$filter=environment eq '<environment-id>'&api-version=1  403 (Forbidden)   base.host.js:2

What we've ruled out

  • Our code: the same failure on an older commit that previously ran in Local Play.
  • Dev server: http://localhost:5173/ and /__vite_powerapps_plugin__/power.config.json both return 200, and the config is valid JSON.
  • Account and environment: PAC CLI is signed in as the same user and environment as the Local Play URL, and the user can play the published app.
  • Browser session: fails the same in Chrome, Edge and an InPrivate/Incognito window.
  • Flows (#307): the app has no flow connection references.

Possibly related

Chrome shows Pop-ups and redirects: Blocked by your administrator for apps.powerapps.com, which means a managed browser policy is in place. The app has three connector connection references (Office 365 Users, SharePoint Online, a custom connector). If Local Play needs a pop-up for connection consent, or needs local network access to localhost, could a managed policy cause exactly this error? If so, a clearer error message would help (see #439).

Environment

  • @microsoft/power-apps 1.1.3
  • @microsoft/power-apps-vite 1.0.2
  • Vite 7.3.3, React 19, Node.js 24.15.0
  • Windows 11, Chrome and Edge (current), managed device
  • Dataverse plus connection references to shared_office365users, shared_sharepointonline and one custom connector

Questions

  1. What causes "Code app URL is not available"? Is the 403 on the environment API the trigger?
  2. Has the hosted player changed in a way that needs a newer @microsoft/power-apps / power-apps-vite? We're on 1.1.3 / 1.0.2, and the latest are 1.5.0 / 1.0.13.
  3. Does Local Play need pop-ups or local network access permission when an admin policy blocks them, and is there a supported workaround?
Ngôn ngữ chính
TypeScript
Star
516
Fork
145
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PowerAppsCodeApps

Tất cả issue của microsoft/PowerAppsCodeApps

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.