Skip to content

Conversation

@HeyyyNeo
Copy link

@HeyyyNeo HeyyyNeo commented Nov 1, 2025

I am able to run the project after changing esm import to dynamic import
Fixes : #14489
This piece of granular code fixes the issue: (Did changes directly in minified js code)

const import_p_map = await import('p-map');
await (0, import_p_map.default)(build.prerender, prerenderSinglePath, { concurrency });

Steps taken to validate the fix

Build is same as previous
Screenshot 2025-11-01 at 7 56 58 PM

How is it verified
In this current project i ran the build and copied the vite.js content and pasted in my own project
Both node v20, v25 runs the project seamlessly

@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2025

🦋 Changeset detected

Latest commit: 6b94e85

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch
react-router Patch
react-router-dom Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Nov 1, 2025

Hi @HeyyyNeo,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

@HeyyyNeo HeyyyNeo changed the title Moved the import from require syntax to dynamic import [Fix]: [Node V20] : [P map Fix]: Moved the import from require syntax to dynamic import Nov 1, 2025
@HeyyyNeo HeyyyNeo changed the title [Fix]: [Node V20] : [P map Fix]: Moved the import from require syntax to dynamic import [Fix]: [Node V20] : [p-map bug]: Moved the import from require syntax to dynamic import Nov 1, 2025
@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch from 07aa497 to 65debd2 Compare November 1, 2025 14:26
@HeyyyNeo HeyyyNeo changed the title [Fix]: [Node V20] : [p-map bug]: Moved the import from require syntax to dynamic import [Fix]: [Node V20] : [p-map bug]: Moved the ESM import to dynamic ESM import Nov 1, 2025
@brophdawg11 brophdawg11 changed the base branch from main to dev November 3, 2025 14:56
@brophdawg11 brophdawg11 changed the base branch from dev to main November 3, 2025 14:57
@brophdawg11
Copy link
Contributor

Thank you for the PR @HeyyyNeo! Would you mind rebasing this onto dev (that's where we do releases from) and signing the CLI and adding a changeset so we can get this merged?

@HeyyyNeo
Copy link
Author

HeyyyNeo commented Nov 3, 2025

sure thing @brophdawg11

@HeyyyNeo HeyyyNeo changed the base branch from main to dev November 3, 2025 15:29
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Nov 3, 2025

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch 8 times, most recently from b06a2b3 to ed4359c Compare November 3, 2025 16:05
@HeyyyNeo
Copy link
Author

HeyyyNeo commented Nov 3, 2025

@brophdawg11 can you please recheck?

@HeyyyNeo
Copy link
Author

HeyyyNeo commented Nov 4, 2025

@timdorr i am new to open source Pull Request practices, is there anything pending? or this PR is ready to be merged?

@brophdawg11
Copy link
Contributor

@HeyyyNeo We use Changesets to auto-generate the CHANGELOG.md files, so you don't need to edit packages/react-router-dev/CHANGELOG.md directly - you can back that change out. Instead, run pnpm changeset and answer the prompts for a patch bump on @react-router/dev and describe the change there and commit that new file instead. Thanks!

@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch from ed4359c to 2570e10 Compare November 4, 2025 15:05
@MichaelDeBoey MichaelDeBoey changed the title [Fix]: [Node V20] : [p-map bug]: Moved the ESM import to dynamic ESM import fix(dev/vite/plugin): fix p-map import Nov 4, 2025
@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch from 2570e10 to 41cd8ea Compare November 4, 2025 15:15
@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch 2 times, most recently from f07fd23 to cb9eab7 Compare November 4, 2025 15:23
@HeyyyNeo
Copy link
Author

HeyyyNeo commented Nov 4, 2025

done @brophdawg11 . Please revalidate
Let me know if it is a minor bump i will push minor bump changeset changes
For now i have pushed the changset as PATCH

@brophdawg11
Copy link
Contributor

It doens't look like you ran pnpm changeset? We don't want to touch any CHANGELOG.md or package.json versions at all - that is all automated via our Changesets tooling.

I made the updates and pushed to this branch to get things straightened out so we can get this merged 👍

@HeyyyNeo
Copy link
Author

HeyyyNeo commented Nov 5, 2025

@brophdawg11 this is what i ran

  1. pnpm changeset init
  2. pnpm changeset (it asks for certain questions) answered them
  3. pnpm changeset version..

@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch 2 times, most recently from e0886b9 to 47f3467 Compare November 5, 2025 16:18
@HeyyyNeo HeyyyNeo force-pushed the bug/p-map-import/fix-node-v20 branch from 47f3467 to 6b94e85 Compare November 5, 2025 16:18
@brophdawg11
Copy link
Contributor

you only needed to run pnpm changeset

pnpm changeset init is a single-use command to setup changesets on a project (we've already done that for RR) and pnpm changeset version is not intended to be run until release time to copy changeset files into CHANGELOG.md files and bump versions in package.json

@brophdawg11 brophdawg11 merged commit 9a0c1fb into remix-run:dev Nov 5, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

p-map import breaks @react-router/dev's node 20 compatibility

4 participants