question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Describe 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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
xzdarcycommented, Apr 12, 2022

I have the same issue, too. When i reinstall the dependencies.

1reaction
message163commented, Apr 12, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent Metadata errors · Issue #7685 · vitejs/vite - GitHub
X [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here: ...
Read more >
OLE DB Provider for DB2 returns an "inconsistent metadata ...
Fixes a problem in which the OLE DB Provider for DB2 returns an "inconsistent metadata" error when it runs a query for an...
Read more >
85 - Stack Overflow
I found a way to fix it. Steps to fix:- Open your package.json file and edit your browserslist as follows.
Read more >
import.meta - JavaScript - MDN Web Docs
meta meta-property exposes context-specific metadata to a JavaScript module. It contains information about the module, such as the module's URL.
Read more >
How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found