vite: esbuild0.14.35 is not compate with vite
Describe the bug
vite: latest esbuild: 0.14.35
✘ [ERROR] [plugin vite:dep-pre-bundle] Detected inconsistent metadata for the path "node_modules/.pnpm/tslib@2.3.1/node_modules/tslib/tslib.es6.js" when it was imported here:
node_modules/.pnpm/injection-js@2.4.0/node_modules/injection-js/util/decorators.js:8:31:
8 │ import { __spreadArrays } from "tslib";
╵ ~~~~~~~
The original metadata for that path comes from when it was imported here:
dep:tslib:2:14:
2 │ export * from "./node_modules/.pnpm/tslib@2.3.1/node_modules/tslib/tslib.es6.js"
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
- "pluginName": null,
- "sideEffects": true,
+ "pluginName": "vite:dep-pre-bundle",
+ "sideEffects": false,
}
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
https://github.com/agileago/fe-template
System Info
System:
OS: macOS 12.2.1
CPU: (4) x64 Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz
Memory: 426.07 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.9.0 - /usr/local/bin/node
Yarn: 1.22.17 - ~/.config/yarn/global/node_modules/.bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Browsers:
Chrome: 100.0.4896.75
Edge: 100.0.1185.39
Safari: 15.3
npmPackages:
@vitejs/plugin-vue: ^2.3.0 => 2.3.1
vite: 2.9.1 => 2.9.1
Used Package Manager
pnpm
Logs
vite:config bundled config file loaded in 376.98ms +0ms
vite:config using resolved config: {
vite:config plugins: [
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:optimized-deps',
vite:config 'vite:html-inline-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite:vue-jsx',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:worker-import-meta-url',
vite:config 'vite:client-inject',
vite:config 'vite:import-analysis'
vite:config ],
vite:config server: {
vite:config preTransformRequests: true,
vite:config fs: { strict: true, allow: [Array], deny: [Array] }
vite:config },
vite:config esbuild: { include: /\.esbuild\./ },
vite:config define: { __VUE_OPTIONS_API__: true, __VUE_PROD_DEVTOOLS__: false },
vite:config configFile: '/Users/titanmatrix/Desktop/vite-react/vite.config.ts',
vite:config configFileDependencies: [ '/Users/titanmatrix/Desktop/vite-react/vite.config.ts' ],
vite:config inlineConfig: {
vite:config root: undefined,
vite:config base: undefined,
vite:config mode: undefined,
vite:config configFile: undefined,
vite:config logLevel: undefined,
vite:config clearScreen: undefined,
vite:config server: {}
vite:config },
vite:config root: '/Users/titanmatrix/Desktop/vite-react',
vite:config base: '/',
vite:config resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
vite:config publicDir: '/Users/titanmatrix/Desktop/vite-react/public',
vite:config cacheDir: '/Users/titanmatrix/Desktop/vite-react/node_modules/.vite',
vite:config command: 'serve',
vite:config mode: 'development',
vite:config isWorker: false,
vite:config isProduction: false,
vite:config build: {
vite:config target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
vite:config polyfillModulePreload: true,
vite:config outDir: 'dist',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: true,
vite:config cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
vite:config sourcemap: false,
vite:config rollupOptions: {},
vite:config minify: 'esbuild',
vite:config terserOptions: {},
vite:config write: true,
vite:config emptyOutDir: null,
vite:config manifest: false,
vite:config lib: false,
vite:config ssr: false,
vite:config ssrManifest: false,
vite:config reportCompressedSize: true,
vite:config chunkSizeWarningLimit: 500,
vite:config watch: null,
vite:config commonjsOptions: { include: [Array], extensions: [Array] },
vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
vite:config },
vite:config preview: {
vite:config port: undefined,
vite:config strictPort: undefined,
vite:config host: undefined,
vite:config https: undefined,
vite:config open: undefined,
vite:config proxy: undefined,
vite:config cors: undefined,
vite:config headers: undefined
vite:config },
vite:config env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config warnOnce: [Function: warnOnce],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen],
vite:config hasErrorLogged: [Function: hasErrorLogged]
vite:config },
vite:config packageCache: Map(0) {},
vite:config createResolver: [Function: createResolver],
vite:config optimizeDeps: {
vite:config esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
vite:config },
vite:config worker: {
vite:config format: 'iife',
vite:config plugins: [
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object], [Object],
vite:config [Object]
vite:config ],
vite:config rollupOptions: {}
vite:config }
vite:config } +5ms
Port 3000 is in use, trying another one...
vite v2.9.1 dev server running at:
> Local: http://localhost:3001/
> Network: use `--host` to expose
ready in 599ms.
vite:deps scanning for dependencies... { timestamp: true } +0ms
vite:deps Crawling dependencies using entries:
vite:deps /Users/titanmatrix/Desktop/vite-react/index.html +0ms
vite:resolve 0.62ms /src/main.tsx -> /Users/titanmatrix/Desktop/vite-react/src/main.tsx +0ms
vite:resolve 11.85ms @abraham/reflection -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/@abraham+reflection@0.10.0/node_modules/@abraham/reflection/dist/index.js +22ms
vite:resolve 2.76ms vue -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js +4ms
vite:resolve 2.02ms vue3-oop -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/vue3-oop@0.5.2_56f444cfeb3af04c1b6e7a04c19810cc/node_modules/vue3-oop/dist/vue3-oop.es.js +3ms
vite:deps Scan completed in 85.19ms: {
'@abraham/reflection': '/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/@abraham+reflection@0.10.0/node_modules/@abraham/reflection/dist/index.js',
vue: '/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js',
'vue3-oop': '/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/vue3-oop@0.5.2_56f444cfeb3af04c1b6e7a04c19810cc/node_modules/vue3-oop/dist/vue3-oop.es.js'
} +66ms
vite:deps dependencies found: @abraham/reflection
vite:deps vue
vite:deps vue3-oop { timestamp: true } +99ms
vite:resolve 7.82ms @vue/runtime-dom -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/@vue+runtime-dom@3.2.31/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0ms
vite:resolve 1.74ms vue -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/vue@3.2.31/node_modules/vue/dist/vue.runtime.esm-bundler.js +2ms
vite:resolve 0.92ms injection-js -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/injection-js@2.4.0/node_modules/injection-js/index.js +2ms
✘ [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/vue3-oop@0.5.2_56f444cfeb3af04c1b6e7a04c19810cc/node_modules/vue3-oop/dist/vue3-oop.es.js:32:294:
32 │ ...onUnmounted, onBeforeUnmount, onUpdated, onBeforeUpdate, onMounted, onBeforeMount, provide, markRaw } 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.
vite:resolve 5.08ms @vue/runtime-core -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/@vue+runtime-core@3.2.31/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +7ms
vite:resolve 1.59ms @vue/shared -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/@vue+shared@3.2.31/node_modules/@vue/shared/dist/shared.esm-bundler.js +3ms
vite:resolve 2.58ms tslib -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/tslib@2.3.1/node_modules/tslib/tslib.es6.js +33ms
vite:resolve 1.41ms @vue/reactivity -> /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/@vue+reactivity@3.2.31/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +14ms
11:35:17 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/.pnpm/vue3-oop@0.5.2_56f444cfeb3af04c1b6e7a04c19810cc/node_modules/vue3-oop/dist/vue3-oop.es.js:32:294: 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 (/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:1603:15)
at /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:1249:28
at runOnEndCallbacks (/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:1034:63)
at buildResponseToResult (/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:1247:7)
at /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:1356:14
at /Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:666:9
at handleIncomingPacket (/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:763:9)
at Socket.readFromStdout (/Users/titanmatrix/Desktop/vite-react/node_modules/.pnpm/esbuild@0.14.35/node_modules/esbuild/lib/main.js:632:7)
at Socket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:324:12)
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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 28 (8 by maintainers)
Links to this issue
Commits related to this issue
- Lock esbuild to 0.14.34 fixes #7683 — committed to bompus/vite by bompus 2 years ago
- Lock esbuild to 0.14.34 fixes #7683 — committed to bompus/vite by bompus 2 years ago
- Lock esbuild to 0.14.34 fixes vitejs#7683 — committed to bompus/vite by bompus 2 years ago
same problem
Lock esbuild to version 0.14.34. It’s likely esbuild had a breakchange.
Critical dependencies of Vite such as ESBuild and Rollup should probably be version-locked to prevent this from happening in the future.
Closing as esbuild 0.14.36 is out reverting the change. Great work @sapphi-red 🙌
@aclec @aladdin-add thanks i got it to work by removing
package-lock.jsonand removingnode_modulesthen rannpm installesbuild dev is aware esbuild/#2177 and reverted the change. Likely will publish 0.14.36 soon.
@aclec i cleared the cache then deleted
node_modulesand then rannpm installand still getting the same error logI’ve temporarily fixed my issue by uninstalling vite and reinstalling v2.7.13 (latest version before vite@2.8.0, which also coincides with the upgrade of esbuild@0.13.12 to esbuild@0.14.14). Not the most ideal solution, but I was also able to get vite working properly in a test project with the
overridesorresolutionstrick in package.json. Hopefully this gets resolved!you’ll need to update/regenerate your lock file. e.g
package-lock.json/yarn.lock/pnpm.lockDowngrade vite from 2.9.1 to 2.7.1 fix this temporary.
same error,when i use
"vite": "~2.7.1"to replace"vite": "~2.7.1", the question resolved.