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

Inconsistent Metadata errors #7685

Closed
7 tasks done
acidjazz opened this issue Apr 12, 2022 · 24 comments
Closed
7 tasks done

Inconsistent Metadata errors #7685

acidjazz opened this issue Apr 12, 2022 · 24 comments

Comments

@acidjazz
Copy link

Describe the bug

I get this when starting my dev server

✘ [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:

    node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187:
      6 │ ...eactive, h, provide, ref, watch, shallowRef, nextTick } from 'vue';
        ╵                                                                 ~~~~~

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

    dep:vue:2:14:
      2 │ export * from "./node_modules/vue/dist/vue.runtime.esm-bundler.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.

Possible duplicate of #7683

Reproduction

https://stackblitz.com/edit/vitejs-vite-f48pac?file=package.json

System Info

System:
    OS: macOS 12.0.1
    CPU: (8) arm64 Apple M1
    Memory: 95.61 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.volta/tools/image/node/16.13.1/bin/node
    Yarn: 1.22.17 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 8.6.0 - ~/.volta/tools/image/npm/8.6.0/bin/npm
  Browsers:
    Chrome: 100.0.4896.75
    Safari: 15.1
  npmPackages:
    @vitejs/plugin-vue: ^2.3.1 => 2.3.1
    vite: ^2.9.1 => 2.9.1

Used Package Manager

yarn

Logs

vite:resolve 0.31ms @vue/runtime-dom -> /Users/k/fume/tailvue/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0ms
  vite:resolve 0.41ms vue -> /Users/k/fume/tailvue/node_modules/vue/dist/vue.runtime.esm-bundler.js +3ms
✘ [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:

    node_modules/@iconify/vue/dist/iconify.mjs:1:35:
      1 │ import { h, defineComponent } from 'vue';~~~~~

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

    dep:vue:2:14:
      2 │ export * from "../node_modules/vue/dist/vue.runtime.esm-bundler.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.

  vite:resolve 0.33ms @vue/runtime-core -> /Users/k/fume/tailvue/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +1ms
  vite:resolve 0.27ms @vue/shared -> /Users/k/fume/tailvue/node_modules/@vue/shared/dist/shared.esm-bundler.js +0ms
  vite:resolve 0.39ms @vue/reactivity -> /Users/k/fume/tailvue/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +10ms
11:03:58 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:

Validations

@AltStuff
Copy link

AltStuff commented Apr 12, 2022

Happens with React JS and React TS as well

$ vite

  vite v2.9.1 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 271ms.

✘ [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.

✘ [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.

10:49:37 PM [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 inconsi    at failureErrorWithLog (D:\projects\web-projects\test\node_modules\esbuild\lib\main.js:1603:15)
    at D:\projects\web-projects\test\node_modules\esbuild\lib\main.js:1249:28
    at runOnEndCallbacks (D:\projects\web-projects\test\node_modules\esbuild\lib\main.js:1034:63)
    at buildResponseToResult (D:\projects\web-projects\test\node_modules\esbuild\lib\main.js:1247:7)
    at D:\projects\web-projects\test\node_modules\esbuild\lib\main.js:666:9
    at Socket.readFromStdout (D:\projects\web-projects\test\node_modules\esbuild\lib\main.js:632:7)
    at Socket.emit (events.js:321:20)
    at addChunk (_stream_readable.js:294:12)

@nathanoffline
Copy link

nathanoffline commented Apr 12, 2022

was just going to file an issue
also tested with React & React TS

> test-vite@0.0.0 dev
> vite

  vite v2.9.1 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 234ms.

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.

9:11:00 PM [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\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:1603:15)
    at C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:1249:28
    at runOnEndCallbacks (C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:1034:63)
    at buildResponseToResult (C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:1247:7)
    at C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:1356:14
    at C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:666:9
    at handleIncomingPacket (C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:763:9)
    at Socket.readFromStdout (C:\Users\gasma\Desktop\projects\test-vite\node_modules\esbuild\lib\main.js:632:7)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)

@qw789
Copy link

qw789 commented Apr 12, 2022

Happens with VUE JS as well
`
node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187:
6 │ ...t, onUnmounted, onDeactivated, onActivated, computed, unref, watchEffect, defineComponent, reactive, h, provide, ref, watch, shallowRef, nextTick } from 'vue';
╵ ~~~~~

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

dep:vue:2:14:
  2 │ export * from "./node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.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.

下午12:21:14 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:
at failureErrorWithLog (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1603:15)
at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1249:28
at runOnEndCallbacks (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1034:63)
at buildResponseToResult (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1247:7)
at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1356:14
at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:666:9
at handleIncomingPacket (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:763:9)
at Socket.readFromStdout (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:632:7)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
Vite Error, /node_modules/.vite/deps/vue-router.js?v=18f23ae8 optimized info should be defined
X [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:

node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187:
  6 │ ...t, onUnmounted, onDeactivated, onActivated, computed, unref, watchEffect, defineComponent, reactive, h, provide, ref, watch, shallowRef, nextTick } from 'vue'; 
    ╵                                                                                                                                                             ~~~~~  

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

dep:vue:2:14:
  2 │ export * from "./node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.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.

下午12:21:19 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:
at failureErrorWithLog (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1603:15)
at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1249:28
at runOnEndCallbacks (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1034:63)
at buildResponseToResult (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1247:7)
at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1356:14
at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:666:9
at handleIncomingPacket (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:763:9)
at Socket.readFromStdout (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:632:7)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
`

@ismoiliy98
Copy link

Happens with preact as well

Logs
❯ yarn dev
yarn run v1.22.17
$ vite

  vite v2.9.1 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 389ms.

✘ [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/preact/dist/preact.module.js" when it was imported here:

    node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js:1:38:
      1 │ import{options as r,Fragment as _}from"preact";export{Fragment}from"preact";var o=0;function e(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u...
        ╵                                       ~~~~~~~~

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

    dep:preact:2:14:
      2 │ export * from "./node_modules/preact/dist/preact.module.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.

✘ [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/preact/dist/preact.module.js" when it was imported here:

    node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js:1:67:
      1 │ import{options as r,Fragment as _}from"preact";export{Fragment}from"preact";var o=0;function e(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u...
        ╵                                                                    ~~~~~~~~

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

    dep:preact:2:14:
      2 │ export * from "./node_modules/preact/dist/preact.module.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.

9:23:20 AM [vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js:1:38: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/preact/dist/preact.module.js" when it was imported here:
node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js:1:67: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/preact/dist/preact.module.js" when it was imported here:
    at failureErrorWithLog (/preact-project/node_modules/esbuild/lib/main.js:1603:15)
    at /preact-project/node_modules/esbuild/lib/main.js:1249:28
    at runOnEndCallbacks (/preact-project/node_modules/esbuild/lib/main.js:1034:63)
    at buildResponseToResult (/preact-project/node_modules/esbuild/lib/main.js:1247:7)
    at /preact-project/node_modules/esbuild/lib/main.js:1356:14
    at /preact-project/node_modules/esbuild/lib/main.js:666:9
    at handleIncomingPacket (/preact-project/node_modules/esbuild/lib/main.js:763:9)
    at Socket.readFromStdout (/preact-project/node_modules/esbuild/lib/main.js:632:7)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)

@Jhonatan-1504
Copy link

i use another version in vue-router is result for me, in react sorry i dont know

i think, this error is in the vite compilation, i have another project with this version vue:

image

it works normally but when i create a new project it throws the error

@qw789
Copy link

qw789 commented Apr 12, 2022

i use another version in vue-router is result for me, in react sorry i dont know

i think, this error is in the vite compilation, i have another project with this version vue:

image

it works normally but when i create a new project it throws the error

you delete the node_modules,reinstall then try it

@abramsotocinal
Copy link

abramsotocinal commented Apr 12, 2022

Same error here

Using vue3-latest

I literally just now uninstalled vue-router and downgraded to v3 of router and works. This is a fresh install btw so i can't tell yet how this will behave

Happens with VUE JS as well ` node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187: 6 │ ...t, onUnmounted, onDeactivated, onActivated, computed, unref, watchEffect, defineComponent, reactive, h, provide, ref, watch, shallowRef, nextTick } from 'vue'; ╵ ~~~~~

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

dep:vue:2:14:
  2 │ export * from "./node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.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.

下午12:21:14 [vite] error while updating dependencies: Error: Build failed with 1 error: node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here: at failureErrorWithLog (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1603:15) at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1249:28 at runOnEndCallbacks (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1034:63) at buildResponseToResult (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1247:7) at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1356:14 at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:666:9 at handleIncomingPacket (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:763:9) at Socket.readFromStdout (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:632:7) at Socket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:315:12) Vite Error, /node_modules/.vite/deps/vue-router.js?v=18f23ae8 optimized info should be defined X [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:

node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187:
  6 │ ...t, onUnmounted, onDeactivated, onActivated, computed, unref, watchEffect, defineComponent, reactive, h, provide, ref, watch, shallowRef, nextTick } from 'vue'; 
    ╵                                                                                                                                                             ~~~~~  

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

dep:vue:2:14:
  2 │ export * from "./node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.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.

下午12:21:19 [vite] error while updating dependencies: Error: Build failed with 1 error: node_modules/.pnpm/vue-router@4.0.14_vue@3.2.31/node_modules/vue-router/dist/vue-router.esm-bundler.js:6:187: ERROR: [plugin: vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here: at failureErrorWithLog (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1603:15) at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1249:28 at runOnEndCallbacks (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1034:63) at buildResponseToResult (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1247:7) at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:1356:14 at E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:666:9 at handleIncomingPacket (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:763:9) at Socket.readFromStdout (E:\demo\2022\my-vue-app\node_modules.pnpm\esbuild@0.14.35\node_modules\esbuild\lib\main.js:632:7) at Socket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:315:12) `

@ismoiliy98
Copy link

The issue seems related to esbuild

A temporary workaround is to add resolution to your package.json:

"resolutions": {
  "esbuild": "0.14.34"
}

@jifakir
Copy link

jifakir commented Apr 12, 2022

Same to me on react
$ vite

vite v2.9.1 dev server running at:

Local: http://localhost:3000/
Network: use --host to expose

ready in 414ms.

✘ [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.

✘ [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.

10:57:04 AM [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 (/run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:1603:15)
at /run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:1249:28
at runOnEndCallbacks (/run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:1034:63)
at buildResponseToResult (/run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:1247:7)
at /run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:1356:14
at /run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:666:9
at handleIncomingPacket (/run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:763:9)
at Socket.readFromStdout (/run/media/fakir/Store/Code/Project/gsap-parallex/node_modules/esbuild/lib/main.js:632:7)
at Socket.emit (node:events:520:28)
at addChunk (node:internal/streams/readable:315:12)

@qw789
Copy link

qw789 commented Apr 12, 2022

thanks,that is useful

@dsrkafuu
Copy link

Same issue here.
PM: pnpm
Vite: 2.9.1

@Geebrox's temporary workaround works well.

The issue seems related to esbuild

A temporary workaround is to add resolution to your package.json:

"resolutions": {
  "esbuild": "0.14.34"
}

@East333
Copy link

East333 commented Apr 12, 2022

I hava the same error, when the version is

"vue": "3.2.26",
"vue-router": "4.0.12",
"@vitejs/plugin-vue": "1.9.4",
"@vue/compiler-sfc": "3.2.22",
"vite": "2.6.14",

things are ok,no error.
But when the version is

"vue": "3.2.31",  
"vue-router": "4.0.12",
"@vitejs/plugin-vue": "2.2.4",
"@vue/compiler-sfc": "3.2.31",
"vite": "2.8.6",

the version of vite is 2.8.6 or 2.9.1 , same error

@nathanoffline
Copy link

Unfortunately, I'm unable to replicate @Geebrox's solution... are resolutions PNPM specific?

@jifakir
Copy link

jifakir commented Apr 12, 2022

The issue seems related to esbuild

A temporary workaround is to add resolution to your package.json:

"resolutions": {
  "esbuild": "0.14.34"
}

Working on Reactjs too, Thanks man!

@East333
Copy link

East333 commented Apr 12, 2022

Unfortunately, I'm unable to replicate @Geebrox's solution... are resolutions PNPM specific?

maybe is yarn

@bluwy
Copy link
Member

bluwy commented Apr 12, 2022

This looks like a duplicate of #7683 as noted in the issue description. Closing to keep discussion in one place.

@bluwy bluwy closed this as completed Apr 12, 2022
@abramsotocinal
Copy link

Thank you, works.

Also, i'm using npm not yarn so if anyone comes here using npm, fyi its equivalent is overrides

"overrides": {
    "esbuild": "0.14.34"
  },

The issue seems related to esbuild

A temporary workaround is to add resolution to your package.json:

"resolutions": {
  "esbuild": "0.14.34"
}

@Abeiv
Copy link

Abeiv commented Apr 12, 2022

The issue seems related to esbuild

A temporary workaround is to add resolution to your package.json:

"resolutions": {
  "esbuild": "0.14.34"
}

Thank man 👍!

@songyu641660583
Copy link

请问解决这个问题了吗,我也是这个问题 vue项目

@Abeiv
Copy link

Abeiv commented Apr 12, 2022

请问解决这个问题了吗,我也是这个问题 vue项目

解决了,删除 node_modules 重新install一下就行了

@songyu641660583
Copy link

Abeiv

谢谢呢
"resolutions": {
"esbuild": "0.14.34"
}
这个方法很好,虽然不知道为什么

@patak-dev
Copy link
Member

Please remove the custom resolutions, esbuild 0.14.36 has been released reverting the problematic change

@East333
Copy link

East333 commented Apr 12, 2022

Abeiv

谢谢呢 "resolutions": { "esbuild": "0.14.34" } 这个方法很好,虽然不知道为什么

原因是vite的依赖包esbuild今天上午发布了一个新版本0.14.35,有问题。0.14.34是没问题的。简单来说,resolutions是yarn的固定版本的一个方法。刚刚,esbuild又发布了一个新版本0.14.36,解决了这个问题

@vL1n
Copy link

vL1n commented Apr 12, 2022

The issue seems related to esbuild

A temporary workaround is to add resolution to your package.json:

"resolutions": {
  "esbuild": "0.14.34"
}

that's useful for me.

@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