Package.json script tasks don't expose npm lifecycle env; cache-enabled tasks strip host-stamped values
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- nodejs, rust
- Área
- build-system, tooling
Línea de trabajo
Comienza en vt_plan, en plan_spawn_execution, e inspecciona EnvFingerprints::resolve, DEFAULT_UNTRACKED_ENV y la inserción existente de MARKER_ENV_NAME. Después, lee de principio a fin el fixture end-to-end de vp_run_env, incluido su caso en caché. Se considera terminado cuando las tareas de package.json conservan el entorno relevante del ciclo de vida de npm, incluidas las tareas con caché habilitada, con cobertura para el comportamiento informado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When vite-task spawns a package.json script, the child gets none of the npm lifecycle environment variables (npm_execpath, npm_config_user_agent, npm_lifecycle_event, npm_node_execpath, …) that npm, pnpm, and Yarn all set when they run scripts. Tools that detect their invoking package manager from that env — npm-run-all2/run-p being the common one — silently fall back to npm, which then fails devEngines.packageManager enforcement in pnpm projects.
Downstream report: voidzero-dev/vite-plus#2317 (vpr check → run-p → npm → EBADDEVENGINES). Reproduced there with a minimal project: pnpm run check sets npm_execpath=<pnpm>/bin/pnpm.mjs, npm_config_user_agent=pnpm/11.20.0 …, npm_lifecycle_event=probe for the child; the same script through the task runner gets none of them.
Why a vite-plus-side fix can't fully cover it
voidzero-dev/vite-plus#2385 stamps npm_execpath / npm_config_user_agent / npm_node_execpath / INIT_CWD into the process env before Session::init snapshots it. That works for plain scripts (which default to cache: scripts: false), but two pieces need the planner:
- Cache-enabled tasks strip the stamped vars again.
plan_spawn_executionrunsEnvFingerprints::resolve(&mut spawn_envs, &cache_config.env_config)before spawning, andDEFAULT_UNTRACKED_ENVcontains no lowercasenpm_*name (matching is case-sensitive on Unix). So forcache: { scripts: true }or config-defined tasks (cached by default), the session-level stamp is filtered out and the npm fallback returns — only in the cached case, which no fixture currently exercises. TheVP_RUNmarker had this exact problem and is re-inserted after the filter, with a comment explaining why. npm_lifecycle_event/npm_lifecycle_scriptare per-task values (script name / script body). Only the planner knows them; a session-level stamp can't provide them. pnpm sets both for every script it runs.
Suggested direction
- Re-insert the lifecycle names post-filter next to the existing
MARKER_ENV_NAMEinsert invt_plan(or add them toDEFAULT_UNTRACKED_ENV), so host-provided lifecycle env survives cache-enabled tasks. - Optionally set
npm_lifecycle_event(andnpm_lifecycle_script) from the task itself when spawning package.json scripts, which vite-plus cannot do from outside.
Happy to send a PR for either or both if the direction sounds right — the vp_run_env e2e fixture looks like the natural place for coverage (its cached case already demonstrates the marker surviving the env filter).
- Lenguaje dominante
- Rust
- Estrellas
- 468
- Forks
- 42
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 46
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 voidzero-dev/vite-task
-
vp run: output forwarding fails with EAGAIN when an inherited Node child sets stdout non-blockingAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
voidzero-dev/vite-task#782 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
remote cache
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
voidzero-dev/vite-task#781 ·
Los mantenedores suelen responder en 1 día
-
remote cache
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
voidzero-dev/vite-task#779 ·
Los mantenedores suelen responder en 1 día
-
remote cache
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
voidzero-dev/vite-task#778 ·
Los mantenedores suelen responder en 1 día
-
fspy misses Bun file reads on Linux (glibc), so cached tasks replay stale outputPosiblemente ocupada @wan9chi la tomó hace 3 días. Abiertofspy
voidzero-dev/vite-task#777 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/vite-task
Issues similares
-
discover: `sudo RTK_DISABLED=$VAR …` is not detected as a bypass when `sudo` is a transparent prefixAbiertoarea:cli bug good first issue priority:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
rtk-ai/rtk#4412 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[review-skill] Unresolved review threads need paginated GraphQL; first:100 silently truncatesAbiertoskill:code-review
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
component:sight
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
agentic-os-org/ANOLISA#4115 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rivet-dev/rivet#5819 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
A-io-database bug needs triage python
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día