Closed agileago closed 2 years ago
same problem
vite: latest esbuild: 0.14.15
You are not using latest version (2.9.1) of vite. You are using 2.8.6. https://github.com/agileago/fe-template/blob/be30a822634cf37ac825a4c58c30377748370852/pnpm-lock.yaml#L6371 Also you are not using esbuild 0.14.15. You are using 0.14.26. https://github.com/agileago/fe-template/blob/be30a822634cf37ac825a4c58c30377748370852/pnpm-lock.yaml#L2542
yes. when i update package and i find error.i dont push it
Please write how to reproduce the error. It is unclear how to reproduce.
Lock esbuild to version 0.14.34. It's likely esbuild had a breakchange.
same error,when i use "vite": "~2.7.1"
to replace "vite": "~2.7.1"
, the question resolved.
Lock esbuild to version 0.14.34. It's likely esbuild had a breakchange.
Looks like this one is affecting.
Validate that path metadata returned by plugins is consistent
The plugin API assumes that all metadata for the same path returned by a plugin's onResolve callback is consistent. Previously this assumption was just assumed without any enforcement. Starting with this release, esbuild will now enforce this by generating a build error if this assumption is violated. The lack of validation has not been an issue (I have never heard of this being a problem), but it still seems like a good idea to enforce it. Here's a simple example of a plugin that generates inconsistent sideEffects metadata:
https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#01435
Lock esbuild to version 0.14.34. It's likely esbuild had a breakchange.
Looks like this one is affecting.
Validate that path metadata returned by plugins is consistent
The plugin API assumes that all metadata for the same path returned by a plugin's onResolve callback is consistent. Previously this assumption was just assumed without any enforcement. Starting with this release, esbuild will now enforce this by generating a build error if this assumption is violated. The lack of validation has not been an issue (I have never heard of this being a problem), but it still seems like a good idea to enforce it. Here's a simple example of a plugin that generates inconsistent sideEffects metadata:
https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#01435
In that way, the author should publish a minor version instead of a patch.
Critical dependencies of Vite such as ESBuild and Rollup should probably be version-locked to prevent this from happening in the future.
PR welcome to lock it in 2.9 (while we look at the compat issue)
I don't think we should version lock esbuild. They (seem to have) made a breaking change in a patch release and broke semver. It should be fine if they made a minor bump instead, otherwise projects don't get patch improvements / security fixes automatically.
I'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 overrides
or resolutions
trick in package.json. Hopefully this gets resolved!
I don't think we should version lock esbuild. They (seem to have) made a breaking change in a patch release and broke semver. It should be fine if they made a minor bump instead, otherwise projects don't get patch improvements / security fixes automatically.
esbuild
is in active development and has not reached version 1.0.0
yet, so if the version will not be "locked" - there can be a lot of problems like this in the future (when esbuild
releases breaking changes). Before bumping the esbuild
s version it should be checked for compatibility with the vite
package(s)
esbuild
is in active development and has not reached version1.0.0
yet, so if the version will not be "locked" - there can be a lot of problems like this in the future (whenesbuild
releases breaking changes). Before bumping theesbuild
s version it should be checked for compatibility with thevite
package(s)
The issue is that esbuild
released a breaking change in a patch release, breaking semver regardless if it's in active development. We would only need to check for compatibility when esbuild bumps a minor.
Downgrade vite from 2.9.1 to 2.7.1 fix this temporary.
esbuild dev is aware esbuild/#2177 and reverted the change. Likely will publish 0.14.36 soon.
having same issue now
Closing as esbuild 0.14.36 is out reverting the change. Great work @sapphi-red 🙌
Im still getting an error.
Here is my log ` ✘ [ERROR] Detected inconsistent metadata for the path "node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:
dep:vue:2:14:
2 │ export * from "./node_modules/vue/dist/vue.runtime.esm-bundler.js"
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
node_modules/@headlessui/vue/dist/headlessui.esm.js:1:172:
1 │ ...s j,onMounted as pt,onUnmounted as Co,provide as Eo,ref as H,toRaw as dt,watch as ft,watchEffect as Be}from"vue";import{h as po,cloneVNode as fo}from"vue";function T(t,n,...u){if(t in n){let o=n[t];return typeof o=="fun...
╵ ~~~~~
The difference in metadata is displayed below:
{
"pluginName": null, }
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/ag-grid-community/dist/ag-grid-community.cjs.js" when it was imported here:
node_modules/ag-grid-vue3/lib/AgGridVue.js:14:36:
14 │ import { ComponentUtil, Grid } from 'ag-grid-community';
╵ ~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
dep:ag-grid-community:1:23:
1 │ export default require("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"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/ag-grid-community/dist/ag-grid-community.cjs.js" when it was imported here:
node_modules/ag-grid-vue3/lib/VueFrameworkOverrides.js:14:42:
14 │ import { VanillaFrameworkOverrides } from 'ag-grid-community';
╵ ~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
dep:ag-grid-community:1:23:
1 │ export default require("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"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/ag-grid-community/dist/ag-grid-community.cjs.js" when it was imported here:
node_modules/ag-grid-vue3/lib/VueFrameworkComponentWrapper.js:14:37:
14 │ import { BaseComponentWrapper } from 'ag-grid-community';
╵ ~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
dep:ag-grid-community:1:23:
1 │ export default require("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"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/ag-grid-community/dist/ag-grid-community.cjs.js" when it was imported here:
node_modules/ag-grid-vue3/lib/AgGridColumn.js:1:27:
1 │ import { ColDefUtil } from 'ag-grid-community';
╵ ~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
dep:ag-grid-community:1:23:
1 │ export default require("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"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/ag-grid-community/dist/ag-grid-community.cjs.js" when it was imported here:
node_modules/ag-grid-vue3/lib/Utils.js:1:30:
1 │ import { ComponentUtil } from 'ag-grid-community';
╵ ~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
dep:ag-grid-community:1:23:
1 │ export default require("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js");
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"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] Detected inconsistent metadata for the path "node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js" when it was imported here:
node_modules/@babel/runtime/helpers/esm/superPropBase.js:1:27:
1 │ import getPrototypeOf from "./getPrototypeOf.js";
╵ ~~~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
node_modules/helper-js/dist/helper-js.esm.js:11:28:
11 │ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"type": "module", }
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] Detected inconsistent metadata for the path "node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js" when it was imported here:
node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js:2:34:
2 │ import assertThisInitialized from "./assertThisInitialized.js";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The original metadata for that path comes from when it was imported here:
node_modules/helper-js/dist/helper-js.esm.js:7:35:
7 │ import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The difference in metadata is displayed below:
{
"type": "module", }
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. `
Im still getting an error.
Here is my log ` ✘ [ERROR] Detected inconsistent metadata for the path "node_modules/vue/dist/vue.runtime.esm-bundler.js" when it was imported here:
If you're using yarn, think to do "yarn clean cache" to get new version.
@aclec im using npm. What do i do?
@ishaiavrahami "npm cache clean --force"
@aclec i cleared the cache then deleted node_modules
and then ran npm install
and still getting the same error log
you'll need to update/regenerate your lock file. e.g package-lock.json
/yarn.lock
/pnpm.lock
@aclec @aladdin-add thanks i got it to work by removing package-lock.json
and removing node_modules
then ran npm install
I have the same problem
@aclec @aladdin-add thanks i got it to work by removing
package-lock.json
and removingnode_modules
then rannpm install
@1291927234 follow this
I will have a try,thanks @ishaiavrahami
Describe the bug
vite: latest esbuild: 0.14.35
Reproduction
https://github.com/agileago/fe-template
System Info
Used Package Manager
pnpm
Logs
Validations