[EVAL] Direct `eval` warning from @protobufjs/inquire during Vite 8 build

Abierto
#486 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
typescript, vite

Línea de trabajo

Start in vite.config and reproduce the Vite 8/Rolldown build to confirm the warning from node_modules/@protobufjs/inquire/index.js:12. Compare the suppression and browser-alias options described in the issue, then verify that the build succeeds without this warning and that browser behavior is unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Warning

During the build/dev process (Vite 8 / Rolldown), the following warning appears:

[EVAL] Use of direct `eval` function is strongly discouraged as it poses security risks and may cause issues with minification.
    ╭─[ node_modules/@protobufjs/inquire/index.js:12:19 ]
    │
 12 │         var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
    │                   ──┬─
    │                     ╰─── Use of direct `eval` here.
    │
    │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
────╯

Source

The eval call lives in @protobufjs/inquire (a transitive dependency pulled in via protobufjs, used by our Cosmos/protobuf tooling). It uses direct eval to conditionally require optional native modules in Node — code that is never actually needed in the browser bundle.

This is a third-party dependency, not our own code, so we can't fix the source directly. The warning is emitted by Rolldown (the bundler behind Vite 8) which flags direct eval because it defeats minification/scope analysis.

Impact

  • Cosmetic warning only — build still succeeds.
  • No runtime security risk in our bundle (the eval path is dead code in the browser).

Possible remediations

  1. Suppress the warning — configure Vite/Rolldown to ignore this specific warning for the @protobufjs/inquire module.
  2. Alias/stub the module — since inquire is only for optional Node-only native modules, alias @protobufjs/inquire to an empty/no-op module in vite.config resolve.alias for browser builds.
  3. Wait for upstream — track whether protobufjs/@protobufjs/inquire moves to indirect eval.

References

Lenguaje dominante
TypeScript
Estrellas
2
Forks
5
Merge medio
22 h 35 min
PR fusionados (30 d)
91

Preparar el entorno

Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de block52/ui

Todos los issues de block52/ui

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.