app:pack aborts when Node writes process warnings to api-mesh stderr
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, node.js
- Área
- cli
Línea de trabajo
Comienza en src/commands/app/pack.js, alrededor de la llamada a aio api-mesh get --json, y lee las pruebas relacionadas en test/commands/app/pack.test.js. Conserva la detección del caso de stderr no-mesh, pero gestiona las advertencias del proceso de Node, y verifica que la ausencia de mensajes de error ya no oculte el fallo original. Ejecuta las pruebas enfocadas de pack y confirma que la búsqueda exitosa del mesh continúa en Node 22.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 28
- Forks
- 41
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de adobe/aio-cli-plugin-app
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
adobe/aio-cli-plugin-app#924 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
adobe/aio-cli-plugin-app#919 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
adobe/aio-cli-plugin-app#890 ·
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
adobe/aio-cli-plugin-app#881 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
adobe/aio-cli-plugin-app#877 · 1 comentario ·
Todos los issues de adobe/aio-cli-plugin-app
Issues similares
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
andromarces/agent-loops#886 ·
Los mantenedores suelen responder en 1 día
-
bug effort:low model:light plan planner:gpt-6-1-sol tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
B: visual
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
FreeTubeApp/FreeTube#9929 ·
Los mantenedores suelen responder en 1 día
-
🐛 Bug: `--clear-screen` not very useful (at least not for dealing with large test/error output)Abiertostatus: in triage type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
mochajs/mocha#6428 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
supabase/supabase-js#2768 ·
Los mantenedores suelen responder en 1 día