Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-balloons-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-router/dev": patch
---

Use a dynamic `import()` to load ESM-only `p-map` dependency to avoid issues on Node 20.18 and below
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,4 @@
- zeromask1337
- zheng-chuang
- zxTomw
- HeyyyNeo
4 changes: 2 additions & 2 deletions packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import pick from "lodash/pick";
import jsesc from "jsesc";
import colors from "picocolors";
import kebabCase from "lodash/kebabCase";
import pMap from "p-map";

import * as Typegen from "../typegen";
import type { RouteManifestEntry, RouteManifest } from "../config/routes";
Expand Down Expand Up @@ -2815,7 +2814,8 @@ async function handlePrerender(
concurrency = prerender.unstable_concurrency ?? 1;
}

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

function getStaticPrerenderPaths(routes: DataRouteObject[]) {
Expand Down
Loading