Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] Power BI connector generated client fails TypeScript type check (Goals operations)

未关闭
#47 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@eschavez 已经在做这个了。

开始于 2026年10月23日。

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
TypeScript
星标
32
派生
9
平均合并
5 小时 29 分钟
30 天内合并 PR
4

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/managed-apps 的其他 Issue

查看 microsoft/managed-apps 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。