Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

[ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here: #236

Open
VictorValdespino opened this issue Apr 12, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@VictorValdespino
Copy link

X [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:

node_modules/react/cjs/react-jsx-dev-runtime.development.js:16:20:
  16 │ var React = require('react');
     ╵                     ~~~~~~~

The original metadata for that path comes from when it was imported here:

dep:react:1:23:
  1 │ export default require("./node_modules/react/index.js");
    ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The difference in metadata is displayed below:

{

  • "pluginName": null,
  • "pluginName": "vite:dep-pre-bundle",
    }

This is a bug in the "vite:dep-pre-bundle" plugin. Plugins provide metadata for a given path in an
"onResolve" callback. All metadata provided for the same path must be consistent to ensure
deterministic builds. Due to parallelism, one set of provided metadata will be randomly chosen for
a given path, so providing inconsistent metadata for the same path can cause non-determinism.

X [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:

node_modules/react-dom/cjs/react-dom.development.js:16:20:
  16 │ var React = require('react');
     ╵                     ~~~~~~~

The original metadata for that path comes from when it was imported here:

dep:react:1:23:
  1 │ export default require("./node_modules/react/index.js");
    ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The difference in metadata is displayed below:

{

  • "pluginName": null,
  • "pluginName": "vite:dep-pre-bundle",
    }

This is a bug in the "vite:dep-pre-bundle" plugin. Plugins provide metadata for a given path in an
"onResolve" callback. All metadata provided for the same path must be consistent to ensure
deterministic builds. Due to parallelism, one set of provided metadata will be randomly chosen for
a given path, so providing inconsistent metadata for the same path can cause non-determinism.

21:48:38 [vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/react-dom/cjs/react-dom.development.js:16:20: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:
node_modules/react/cjs/react-jsx-dev-runtime.development.js:16:20: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:
at failureErrorWithLog (C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:1603:15)
at C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:1249:28
at runOnEndCallbacks (C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:1034:63)
at buildResponseToResult (C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:1247:7)
at C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:1356:14
at C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:666:9
at handleIncomingPacket (C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:763:9)
at Socket.readFromStdout (C:\Users\vmvj1\Documents\ProyectosReact\control-gastos\node_modules\esbuild\lib\main.js:632:7)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)

@VictorValdespino VictorValdespino added the bug Something isn't working label Apr 12, 2022
@suga0828
Copy link

Same here.

@gongzemin
Copy link

Me too.

@hothear
Copy link

hothear commented Apr 12, 2022

Me too,how can i do

@suga0828
Copy link

I delete the node_modules folder, install dependencies again and it's working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants