Simple express example not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- express, javascript, nodejs
- Domain
- backend, build-system
Research direction
Start with the WORKSPACE setup and the BUILD rule using node_binary, then reproduce the failure with bazel run :binary. Inspect how the generated express dependency contributes paths to the runfiles tree, especially the absolute path reported for History.md. Done means the example builds and runs without the absolute-path error.
Written by the indexing model from the issue text.
Description
I am trying to put together a simple express example to try these out (since I've been able to get further with them than bazelbuild/rules_nodejs), and I'm running into an issue.
To reproduce (on top of standard WORKSPACE @ 4fe6494f):
# Set up express dependency.
# see: https://github.com/dropbox/rules_node/issues/3
bazel run @org_dropbox_rules_node//node/tools/npm:gen_build_npm -- express@4.16.2 $PWD/
I then append (adding node_binary to the load()):
node_binary(
name = 'binary',
srcs = ['index.js'],
main = 'index.js',
deps = [
':express',
],
)
However, when I bazel run :binary I'm getting:
$ bazel run :binary
INFO: Analysed target //:binary (0 packages loaded).
INFO: Found 1 target...
ERROR: /home/mattmoor/trying-node/BUILD:334:1: Creating runfiles tree bazel-out/local-opt/bin/binary.runfiles failed (Exit 1)
_bin/build-runfiles (args bazel-out/local-opt/bin/binary.runfiles_manifest bazel-out/local-opt/bin/binary.runfiles): paths must not be absolute: line 1: '/node_modules/express/History.md /home/mattmoor/.cache/bazel/_bazel_mattmoor/e6c1f9a612e03cb822c6e33f6e63f45c/execroot/__main__/bazel-out/local-opt/bin/node_modules/express/History.md'
Target //:binary failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.647s, Critical Path: 1.38s
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target
The contents of index.js don't even matter. Am I holding it wrong? Any workarounds?
Bazel version info:
$ bazel version
Build label: 0.7.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Oct 18 14:27:19 2017 (1508336839)
Build timestamp: 1508336839
Build timestamp as int: 1508336839
- Dominant language
- Python
- Stars
- 53
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/rules_node
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
dropbox/rules_node#19 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
dropbox/rules_node#18 ·
-
Webpak Build Error Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
dropbox/rules_node#16 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
dropbox/rules_node#6 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
dropbox/rules_node#3 · 3 comments ·
All issues in dropbox/rules_node
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·