Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
7 tasks done
Flamessea opened this issue Apr 12, 2022 · 8 comments

Comments

@Flamessea
Copy link

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

@JoaoDanielRamos
Copy link

I am having the same issue, just reported it as well.

@xzdarcy
Copy link

xzdarcy commented Apr 12, 2022

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

@bompus
Copy link
Contributor

bompus commented Apr 12, 2022

Duplicate of #7683

@jerrywu001
Copy link

I am having the same issue, just reported it as well.

npm create vite@latest react-demo -- --template react-ts

my package.json

{
  "name": "react-demo",
  "private": true,
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "react": "^18.0.0",
    "react-dom": "^18.0.0"
  },
  "devDependencies": {
    "@types/react": "^18.0.1",
    "@types/react-dom": "^18.0.0",
    "@vitejs/plugin-react": "^1.3.0",
    "typescript": "^4.6.3",
    "vite": "^2.9.1"
  }
}

@East333
Copy link

East333 commented Apr 12, 2022

because esbuild publish 0.14.35 today,it is not compare with vite new version

@Flamessea
Copy link
Author

Duplicate of #7683

oh thanks, I should probably take a look at theirs first. 0.0

@message163
Copy link

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

@haoqunjiang
Copy link
Member

Fixed in esbuild 0.14.36

@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants