Skip to content

Commit af293cf

Browse files
authored
fix: do not test version in canary builds (#10991)
* fix: do not test version in canary builds * chore: typo
1 parent 8dcd915 commit af293cf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/rspack/src/util/bindingVersionCheck.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ export const checkVersion = () => {
1111
return null;
1212
}
1313

14+
// In canary version, version bump is done after binding is built.
15+
// And to export `EXPECTED_RSPACK_CORE_VERSION` in binding, it relies on the bumped version of @rspack/core.
16+
// So we can't check the version of @rspack/core and @rspack/binding in canary version.
17+
// Here we ignore version check for canary version.
18+
if (CORE_VERSION.includes("canary")) {
19+
return null;
20+
}
21+
1422
return new Error(
1523
errorMessage(CORE_VERSION, binding.EXPECTED_RSPACK_CORE_VERSION)
1624
);
@@ -21,13 +29,15 @@ const errorMessage = (coreVersion: string, expectedCoreVersion: string) => {
2129
return `Unmatched version @rspack/core@${coreVersion} and binding version.
2230
2331
Help:
24-
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}'). The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
32+
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
33+
The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
2534
`;
2635
}
2736

2837
return `Unmatched version @rspack/core@${coreVersion} and @rspack/binding.
2938
3039
Help:
3140
Please ensure the version of @rspack/binding and @rspack/core is the same.
41+
The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
3242
`;
3343
};

0 commit comments

Comments
 (0)