vp migrate crashes with "Undefined meta var" when a migrated config string contains `$`
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Describe the bug
vp migrate crashes when a config value it merges into vite.config.ts contains $ followed by uppercase letters or digits, for example $200 or $FOO.
■ Fail to parse yaml as Rule.
Error: Fail to parse yaml as Rule.
cause: Error: Undefined meta var `200` used in `fix`.
The crash happens after migration has already deleted eslint.config.mjs and written .oxlintrc.json, so the project is left half-migrated.
It looks like generate_merge_rule in crates/vp_migration/src/vite_config.rs pastes the JSON config text into the ast-grep fix: template, where $NAME and $<digits> are metavariable syntax. Any string value with that shape breaks the rule, for example an ESLint message, an i18n ignore list or a URL with $ in it.
Expected: string values are inserted literally.
I intend to submit a PR for this.
Reproduction
Inline below. It needs three files and no repo.
Steps to reproduce
package.json
{
"name": "vp-migrate-dollar-repro",
"private": true,
"type": "module",
"packageManager": "[email protected]",
"devDependencies": {
"vite": "8.2.2",
"eslint": "10.8.1"
}
}
eslint.config.mjs
export default [
{
rules: {
'no-restricted-imports': ['error', {
paths: [{ name: 'moment', message: 'Use date-fns. moment costs $200 of bundle budget.' }],
}],
},
},
];
vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({});
git init && git add -A && git commit -m init
pnpm install
pnpm dlx [email protected] vp migrate --no-interactive
git status --porcelain
Result: exit code 1 with the error above. git status shows eslint.config.mjs deleted and .oxlintrc.json untracked. Changing $200 to 200 dollars makes the migration succeed.
System Info
# vp env current: not available, the global vp CLI is not installed (ran through pnpm dlx)
$ pnpm dlx [email protected] vp -V
vp v1.1.0
Local vite-plus:
vite-plus v1.1.0
Tools:
vite v8.3.3
rolldown v1.2.12
vitest v5.0.3
oxfmt v0.72.0
oxlint v1.87.0
oxlint-tsgolint v7.0.2003
macOS 26.6.2 arm64, Node v22.23.2, pnpm 10.14.0
Used Package Manager
pnpm
Logs
■ Fail to parse yaml as Rule.
Error: Fail to parse yaml as Rule.
at mergeAndRemoveJsonConfig (vite-plus/dist/editor-B8tkz7nL.js:9238:17)
code: 'GenericFailure',
cause: Error: Undefined meta var `200` used in `fix`.
at mergeAndRemoveJsonConfig (vite-plus/dist/editor-B8tkz7nL.js:9238:17)
at mergeViteConfigFiles (vite-plus/dist/editor-B8tkz7nL.js:9184:3)
at rewriteMonorepoProject (vite-plus/dist/editor-B8tkz7nL.js:9988:2)
at rewriteRootWorkspacePackageJson (vite-plus/dist/editor-B8tkz7nL.js:7947:2)
at rewriteMonorepo (vite-plus/dist/editor-B8tkz7nL.js:9949:2)
at executeMigrationPlan (vite-plus/dist/migration/bin.js:3860:32)
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- Lenguaje dominante
- Rust
- Estrellas
- 6k
- Forks
- 274
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 206
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-plus
-
pending triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
voidzero-dev/vite-plus#2882 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
voidzero-dev/vite-plus#2097 · 10 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
`vp dev` does not print "ready in N ms"Posiblemente ocupada @fengmk2 la tomó hoy. Abiertobug
voidzero-dev/vite-plus#3053 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
the `vp migrate` command wrongly rewrite "vite/rolldown/plugins" to "vite-plus/rolldown/plugins"Abiertopending triage
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
voidzero-dev/vite-plus#3050 ·
Los mantenedores suelen responder en 1 día
-
Add a dedicated Package Management section with command reference pagesPosiblemente ocupada @jong-kyung la tomó hace 1 día. Abiertodocumentation
voidzero-dev/vite-plus#3041 · 4 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/vite-plus
Issues similares
-
Bump anybuf version to ^1.0.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
wormhole-foundation/wormhole#5062 ·
Los mantenedores suelen responder en 1 día
-
RUSTSEC-2026-0348: Brotli certificate decompression can allocate up to 1 GiB before authenticationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 62/100
-
core: Amount::from_str panics on values above 21M BTC instead of returning an errorPosiblemente ocupada @bhuvan-somisetty la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
crate: spate-s3
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día