-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Bug]: patch_node_fs = True cause next.js standalone build not properly symlink node modules #1033
Comments
Do you mind sharing a minimal setup or repository for building with standalone? Thanks! |
+1 - there's not enough info in the original post for us to debug this.
|
Oof, so I think I'm running into this issue as well, except using It seems that some of the modules are being resolved in the node_modules path 1 (root):
node_modules path 2 (runfiles):
And sadly, Webpack is resolving modules like 'react' and other 1st-party dependencies in both trees (which immediately causes React hook errors). I'm trying to create a minimal reproduction that I can send in but having a bit of trouble reproducing in a smaller context. (The project I'm working on is quite large so I'm trying to figure out what exactly triggers the problem) |
@alexeagle will get back to you with example |
We're having the same issue, error:
We using NextJS 14.1.0 with js_run_binary(
name = "frontend",
srcs = [
// sources
],
args = [
"build",
"--no-lint",
],
chdir = package_name(),
out_dirs = [".next"],
tool = ":next_js_binary",
visibility = ["//visibility:public"],
) The issue seems to be that the NextJS project works as intended but it creates |
What happened?
when building with next, node module inside standalone will be symlinks, but the files generated by bazel build will have symlink to some absolute path, make the following packing process very hard, make patch_node_fs = False seems works
Version
Development (host) and target OS/architectures:
Output of
bazel --version
:Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved:
How to reproduce
No response
Any other information?
No response
The text was updated successfully, but these errors were encountered: