app:pack aborts when Node writes process warnings to api-mesh stderr
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- javascript, node.js
- 領域
- cli
調査の方向性
src/commands/app/pack.js の aio api-mesh get --json 呼び出し付近から始め、関連するテストを test/commands/app/pack.test.js で確認してください。Node プロセスの警告を処理しつつ no-mesh stderr ケースの検出を維持し、エラーメッセージがない場合に元の失敗が隠されなくなったことを検証してください。対象を絞った pack テストを実行し、Node 22 で正常な mesh lookup が続行されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
app:pack treats any output on the aio api-mesh get --json child process' stderr as a fatal error:
https://github.com/adobe/aio-cli-plugin-app/blob/master/src/commands/app/pack.js#L198-L202
const { stdout, stderr } = await execa('aio', ['api-mesh', 'get', '--json'], { cwd: process.cwd() })
if (stderr) {
throw new Error(stderr)
}
Node process warnings are written to stderr while the command still exits 0. On Node 22 the punycode deprecation (DEP0040) is emitted on essentially every aio invocation, so a successful mesh lookup aborts packaging, with the deprecation notice reported as the error.
The thrown message doesn't contain Unable to get mesh config., so it falls through the classification below and is rethrown, failing the whole command.
Steps to reproduce
- Node 22 (
v22.22.2here),@adobe/aio-cli11.1.2,@adobe/aio-cli-plugin-app14.8.1,@adobe/aio-cli-plugin-api-mesh5.7.0 installed - Run
aio app:packin any App Builder project
- Getting api-mesh config...
✖ Command failed with exit code 1: aio api-mesh get --json
(node:42333) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
› Error: Command failed with exit code 1: aio api-mesh get --json
Confirming the warning goes to stderr on an otherwise clean run:
$ aio api-mesh get --json 2>/tmp/err.txt >/tmp/out.txt ; cat /tmp/err.txt
(node:25694) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Expected behaviour
Node process warnings on the child's stderr should not be interpreted as an api-mesh failure.
Note on the stderr check
The if (stderr) throw is not redundant and shouldn't simply be dropped — it is how the "no mesh" case is detected. api-mesh:get reports that via this.error(msg, { exit: false }), which writes to stderr and exits 0, so execa resolves:
https://github.com/adobe/aio-cli-plugin-api-mesh/blob/main/src/commands/api-mesh/get.js
The fix therefore needs to keep the check but exclude Node process warnings from it.
Secondary bug in the same block
if (err?.message.includes('Error: Unable to get mesh config.')) {
The optional chaining stops one level short. If a thrown value has no message — a non-Error throw, or an execa error carrying output only on stderr — this raises TypeError: Cannot read properties of undefined (reading 'includes') inside the catch, masking the original failure. This is currently asserted as expected behaviour in test/commands/app/pack.test.js:
await expect(command.createDeployYamlFile(extConfig)).rejects.toEqual(TypeError('Cannot read properties of undefined (reading \'includes\')'))
Environment
| OS | Linux 5.15 (Ubuntu) |
| Node | v22.22.2 |
@adobe/aio-cli |
11.1.2 |
@adobe/aio-cli-plugin-app |
14.8.1 |
@adobe/aio-cli-plugin-api-mesh |
5.7.0 |
I have a fix ready and will open a PR referencing this issue.
- 主要言語
- JavaScript
- スター
- 28
- フォーク
- 41
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adobe/aio-cli-plugin-app のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
adobe/aio-cli-plugin-app#924 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
adobe/aio-cli-plugin-app#919 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
adobe/aio-cli-plugin-app#890 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
adobe/aio-cli-plugin-app#881 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
adobe/aio-cli-plugin-app#877 · コメント 1 件 ·
adobe/aio-cli-plugin-app の issue をすべて見る
似ている issue
-
docs hacktoberfest help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pacocartones/free-llm-api-hub#347 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cytoscape/cytoscape.js#3536 ·
メンテナーはふだん 15 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cuttle-cards/cuttle#1440 ·
メンテナーはふだん 1 日以内に返信
-
URL-encoded parser builds nested objects nothing reads対応中かも @Senthil455 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
Janani-bn/CivicFix#168 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
code-yeongyu/oh-my-openagent#10172 ·
メンテナーはふだん 1 日以内に返信