-
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
nodejs_binary failed to resolve transitive @npm dependencies #443
Comments
The workaround I have ATM is to add a |
@alexeagle Correct me if I'm wrong but if the npm package google-protobuf is a runtime dependency of the nodejs_binary rule then it needs to be in the data attribute. Or do we want to pick up all transitive @npm dependencies downstream in the nodejs_binary rule? Could cause an issue with multiple roots if different upstream rules use different node_modules. |
I face the same issue with a
while the module is in
Adding the dep in the
@ashi009 Did you find a better way to solve this? Manually adding all the deps on data attribute of |
It seems that 0.27.12 solved this for me. I can now build without specifying the ts_library(
name = "cli",
srcs = ["main.ts"],
deps = ["//greeter"],
)
# combine the individual modules into a single file
rollup_bundle(
name = "bundle",
entry_point = "cli/main.js",
deps = [":cli"],
)
nodejs_binary(
name = "app",
data = [
":cli",
],
entry_point = "demo/cli/main.js",
) |
Great, I didn't even think about nodejs_binary also now receiving the transitive data |
Lucky fix then ;) |
We used a depset for a collection which is only used within the context of a single target: the files[] block in the generated tsconfig. As documented on https://docs.bazel.build/versions/master/skylark/depsets.html: "If you don’t need the merge operation, consider using another type, such as list or dict." The problem is exposed by --incompatible_depset_is_not_iterable which fails at the spot where we iterated the depset of files, showing that it should have been a list. Also clean up a warning about the deprecated load of jasmine_node_test See bazel-contrib#443 Closes bazel-contrib#451 PiperOrigin-RevId: 249758830
We used a depset for a collection which is only used within the context of a single target: the files[] block in the generated tsconfig. As documented on https://docs.bazel.build/versions/master/skylark/depsets.html: "If you don’t need the merge operation, consider using another type, such as list or dict." The problem is exposed by --incompatible_depset_is_not_iterable which fails at the spot where we iterated the depset of files, showing that it should have been a list. Also clean up a warning about the deprecated load of jasmine_node_test See bazel-contrib#443 Closes bazel-contrib#451 PiperOrigin-RevId: 249758830
I'm trying to create a nodejs_binary target with ts_library outputs with the latest nodejs/typescript rules releases.
//test/index.ts
//test/BUILD.bazel
Output from bazel run
The text was updated successfully, but these errors were encountered: