Skip to content

Commit f07fd23

Browse files
committed
[Fix:Node-v20]: Dynamic inline import for p-map
1 parent 89e2bfe commit f07fd23

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,4 @@
452452
- zeromask1337
453453
- zheng-chuang
454454
- zxTomw
455+
- HeyyyNeo
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": major
3+
---
4+
5+
normal ESM import for library p-map was not supported under specific Node 20 versions. We have changed the esm import to dynamic inline esm import.

packages/react-router-dev/vite/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import pick from "lodash/pick";
3636
import jsesc from "jsesc";
3737
import colors from "picocolors";
3838
import kebabCase from "lodash/kebabCase";
39-
import pMap from "p-map";
4039

4140
import * as Typegen from "../typegen";
4241
import type { RouteManifestEntry, RouteManifest } from "../config/routes";
@@ -2815,6 +2814,7 @@ async function handlePrerender(
28152814
concurrency = prerender.unstable_concurrency ?? 1;
28162815
}
28172816

2817+
const pMap = (await import("p-map")).default;
28182818
await pMap(build.prerender, prerenderSinglePath, { concurrency });
28192819
}
28202820

0 commit comments

Comments
 (0)