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
NodeJS require paths are relative to the proto/grpc rule #107
Comments
This is because the To fix this, we'd either need to have support from rules_nodejs for producing a package that has a path pointing into the In either case, the import would become |
Pending on bazelbuild/rules_nodejs#2482 |
Experiencing the same issue with
|
There will hopefully be a fix for this coming: bazelbuild/rules_nodejs#2519 To maintain backwards compatibility, this'll have to be an opt-in mode at least for the 3.x.x cycle. |
Support for the required prefix stripping feature in rules_nodejs landed in 3.2.3, meaning I can begin looking to implement this. |
This will be fixed in 4.0.0. The require path will by default have the name_pb removed, with an option to use the old behaviour |
The require path for the
_pb.js
files generated by thenodejs_*
rules is inconsistent with other language implementations.In the cpp example:
#include "example/proto/routeguide.grpc.pb.h"
matches the location of the routeguide proto in the repo (example/proto/routeguide.proto
).In the nodejs example:
require('routeguide/routeguide_pb/example/proto/routeguide_pb.js')
appears to be{path/to/nodejs_grpc_library}/example/proto/routeguide.proto
. This inconsistency leads to long, hard to parse require paths, and obscures the actual location of the .proto file when reading source code.The text was updated successfully, but these errors were encountered: