Skip to content

Commit 51eb914

Browse files
Merge branch 'main' into dependabot/npm_and_yarn/hono-4.10.3
2 parents 46c82dc + 7db2466 commit 51eb914

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@module-federation/typescript": patch
3+
---
4+
5+
Fix URL construction in FederatedTypesPlugin for Node.js >22.11 compatibility
6+
7+
Fixed incorrect use of `path.join()` for URL construction in FederatedTypesPlugin.ts which was causing "Invalid URL" errors in Node.js versions greater than 22.11. The fix properly uses the URL constructor with the base URL as the second parameter instead of concatenating URLs with path.join().
8+
9+
This resolves compatibility issues when downloading remote types in newer Node.js environments.

packages/typescript/src/plugins/FederatedTypesPlugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ export class FederatedTypesPlugin {
327327
await Promise.all(
328328
filesToCacheBust.filter(Boolean).map((file) => {
329329
const url = new URL(
330-
path.join(origin, typescriptFolderName, file),
330+
path.join(typescriptFolderName, file),
331+
origin,
331332
).toString();
332333
const destination = path.join(
333334
this.normalizeOptions.webpackCompilerOptions.context as string,

0 commit comments

Comments
 (0)