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] Power BI connector generated client fails TypeScript type check (Goals operations)

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

@eschavez đang làm issue này rồi.

Từ ngày 23/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug

Describe the bug
After adding the Power BI connector (shared_powerbi) as an action-mode data source, the generated client fails tsc --noEmit with two errors, both in Goals (scorecard) operations. The app only calls ExecuteDatasetQuery, but the generated files include all 24 operations, so the type check fails and the app can't pass a pre-publish type check. Regenerating (refresh data source) produces the same output.

Errors:

generated/models/PowerBIModel.ts(299,14): error TS2552: Cannot find name 'GoalValueOrNoteUpsertedstatus'. Did you mean 'GoalValueOrNoteUpserted'?
generated/services/PowerBIService.ts(153,5): error TS1016: A required parameter cannot follow an optional parameter.
  1. GoalValueOrNoteUpserted.checkIns[].status references a type GoalValueOrNoteUpsertedstatus that is never emitted (looks like an inline enum/string schema that the generator names but doesn't define):
// The status of the goal at the time of check-in.
status?: GoalValueOrNoteUpsertedstatus;
  1. GetGoal puts a required $expand after the optional pbi_source. Per the Power BI REST docs (Goals – Get By ID), expand is an optional query parameter:
public static async GetGoal(
  groupid: string,
  scorecardId: string,
  goalId: string,
  pbi_source?: string,
  $expand: string
): Promise<IOperationResult<FetchedGoal>>

Steps to Reproduce

  1. Create a code app / managed app (React + Vite + TypeScript template).
  2. Add data source: connector shared_powerbi, action mode (no table).
  3. Run tsc -p tsconfig.app.json --noEmit (or the template's typecheck script).
  4. Observe the two errors above. Refresh/regenerate the data source: same result.

Expected behavior
Generated files type-check without manual edits. Either emit the missing GoalValueOrNoteUpsertedstatus type (or fall back to string), and generate $expand as optional ($expand?: string) or order required parameters before optional ones.

Environment information

  • Package: @microsoft/managed-apps 0.5.11 (app built with App Builder in Microsoft 365 Copilot)
  • TypeScript ~5.8.3, Vite 7
  • Connector: shared_powerbi (Power BI, Microsoft), action mode
  • Production build (vite build) succeeds; only the type check fails.

Workaround
None without hand-editing generated files (which are overwritten on refresh). Fixing the two lines locally (status?: string; and $expand?: string) makes the type check pass.

Related
Originally filed as microsoft/PowerAppsCodeApps#510 and redirected here.

Ngôn ngữ chính
TypeScript
Star
32
Fork
9
Merge trung bình
5 giờ 29 phút
Pull request đã merge (30 ngày)
4

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/managed-apps

Tất cả issue của microsoft/managed-apps

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.