why X [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:
See original GitHub issueDescribe the bug
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.
Reproduction
[ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path “node_modules/react/index.js” when it was imported here:
System Info
System:
OS: Windows 10 10.0.19044
CPU: (4) x64 Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz
Memory: 6.57 GB / 15.95 GB
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.1023.0)
Internet Explorer: 11.0.19041.906
npmPackages:
@vitejs/plugin-react: ^1.0.7 => 1.3.0
vite: ^2.9.0 => 2.9.1
Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
I have the same issue, too. When i reinstall the dependencies.
vite 2.9.1 降级 2.7.1 修复此问题 esbuild 降级 0.14.34 修复此问题
Vite 2.9.1 downgrade 2.7.1 fix this problem Esbuild downgraded to 0.14.34 to fix this problem