-
Notifications
You must be signed in to change notification settings - Fork 524
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
Issue with nodejs_binary typescript entry_point defined as label (0.31.1 release) #834
Comments
Thanks for the report & repro. Thats a nice catch. The underlying cause is that the path to main.js is
The node resolver doesn't handle this case properly and throws thinking that the fully qualified entry_point path of |
I think two fixes are needed here. First, the node resolver should not look at module roots when resolving a main file:
second, we can move the runfiles resolve
to before module root resolve so that you can have fully qualified require |
🐞 bug report
Affected Rule
The issue is caused by the rule:
nodejs_binary
Is this a regression?
Yes, the previous version in which this bug was not present was: 0.30.2
Description
After switching from string-defined entry_point (0.30.2):
to label (0.31.1):
bazel run
produces error:No file workspace_name/src/main.js found in module root workspace_name/src/src/main.js
.For some reason it is looking for a js file under
/src/src/
.🔬 Minimal Reproduction
Use this repo to reproduce: https://github.com/siberex/bazel_issue_rules_nodejs_entry_point
git clone git@github.com:siberex/bazel_issue_rules_nodejs_entry_point.git /tmp/entry_point_label cd /tmp/entry_point_label bazel run //src:server
🔥 Exception or Error
🌍 Your Environment
Output of
bazel version
:Rules version (SHA):
Anything else relevant?
Workaround for this is to add
src/src/main.ts
:The text was updated successfully, but these errors were encountered: