Skip to content
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

fix: #3054 regression in linker behavior in 4.4.2 #3059

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

gregmagolan
Copy link
Collaborator

@gregmagolan gregmagolan commented Nov 4, 2021

resolves: #3054

This restores the linker behaviour from 4.4.1.

The problem seems to be that after the refactor in 4.4.2, the linker is now creating a node_modules symlink at the root of the bazel-out tree where as before the refactor it wasn't.

In short, in 4.4.2 there is now node_modules symlinked at,

execroot/<wksp>/bazel-out/darwin-fastbuild/bin/node_modules -> execroot/<wksp>/node_modules

while in 4.4.1 this wasn't created.

The error for the nextjs build AFAICT is that it is resolving react to the two different node_modules trees in the build which is breaks the react build. React requires a single version at a single node_modules location. I've seen the error produced by next.js before due to this problem in another scenario:

Error occurred prerendering page "/500". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

The execroot/<wksp>/bazel-out/darwin-fastbuild/bin/node_modules is redundant anyway since standard node_modules resolution will go down the tree and find execroot/<wksp>/node_modules without any extra help.

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

🧙🏻

@alexeagle alexeagle merged commit ccf54bc into bazelbuild:stable Nov 4, 2021
@ghost
Copy link

ghost commented Nov 4, 2021

Thank you. We've been seeing this with 4.4.2 and had not yet understood the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change in run_node behaviour from 4.4.1 to 4.4.2
2 participants