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 查找会继续进行。
由索引模型根据 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 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 一周以上 新手友好度 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
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
maproulette/maproulette-frontend#2944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
jaegertracing/jaeger-ui#4618 ·
维护者通常 1 天内回复
-
area:plugins enhancement platform:vscode
难度 2/5 1-3 小时 新手友好度 88/100
anthropics/claude-code#103166 ·
维护者通常 1 天内回复
-
check:failed logos:add
难度 1/5 1 小时以内 新手友好度 78/100
-
[workshop-sim] Improve: Add verifiable checkpoint and bridge to Step 5 (What Are Agentic Workflows?)未关闭feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 88/100
githubnext/gh-aw-workshop#4715 ·
维护者通常 1 天内回复