Skip to content

fix(image-optimization): Workaround for broken symlink dereferencing in Node 22.17.0 and 22.17.1 #934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 29, 2025

Conversation

sommeeeer
Copy link
Contributor

@sommeeeer sommeeeer commented Jul 26, 2025

For #933

The dereference: true option in fs.cpSync() is broken on Node version 22.17.0 and 22.17.1. This fix will do it manually for the binaries in node_modules/.bin. We can revert this once fixed upstream. I guess we could in theory just skip these files aswell, as they probably wont be used.

npm install will create symbolic links by default for binaries in node_modules/.bin. I tried using bin-links in npm install but I did not get it to work with our command.

Copy link

changeset-bot bot commented Jul 26, 2025

🦋 Changeset detected

Latest commit: 21efa91

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

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-router 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

Copy link

pkg-pr-new bot commented Jul 26, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/@opennextjs/aws@934

commit: 21efa91

@sommeeeer sommeeeer requested a review from conico974 July 29, 2025 08:00
@sommeeeer
Copy link
Contributor Author

Thanks for the reviews! Could you take another look when you have time Nico? We could in theory just skip the node_modules/.bin folder aswell, cause CLI commands wont be used in a server function bundle.

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks

@conico974 conico974 merged commit bfde44e into opennextjs:main Jul 29, 2025
3 checks passed
@sommeeeer sommeeeer deleted the fix-installdeps-node-22.17 branch July 29, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants