Skip to content

Build fails when using the protobuf.js library #45

@rohanag12

Description

@rohanag12

The library: protobuf.js

To reproduce (Using the latest commit to this repo):

WORKSPACE

RULES_NODE_COMMIT = 'a447bee6fec5a6b64b6b2dd5dfe0f0597c648d1c'
RULES_NODE_SHA256 = '551f19fb02f97ccb68c78ec20e4190378e46129fc9594ed01be0baa0c224ec14'

http_archive(
    name = "org_pubref_rules_node",
    url = "https://github.com/pubref/rules_node/archive/%s.zip" % RULES_NODE_COMMIT,
    strip_prefix = "rules_node-%s" % RULES_NODE_COMMIT,
    sha256 = RULES_NODE_SHA256
)

load("@org_pubref_rules_node//node:rules.bzl", "node_repositories", "yarn_modules")
node_repositories()

yarn_modules(
  name = "vc_server_deps",
  deps = {
    "protobufjs": "~6.8.0"
  }
)

BUILD

load("@org_pubref_rules_node//node:rules.bzl", "node_binary", "node_module")

node_module(
  name = "server-module",
  description = "Server",
  srcs = [
    "index.js"
  ],
  deps = [
    "@vc_server_deps//:_all_"
  ],
  main = "index.js"
)

index.js

console.log('HELLO');

bazel build //...

.......................
ERROR: /Users/rohan/nodejstest/BUILD:3:1: no such package '@vc_server_deps//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/org_pubref_rules_node/node/internal/yarn_modules.bzl", line 66
		execute(ctx, ([node, "internal/parse_yarn_...), ...)
	File "/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/org_pubref_rules_node/node/internal/yarn_modules.bzl", line 4, in execute
		fail((" ".join(cmds) + ("failed: \nST...))))
/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/node/bin/node internal/parse_yarn_lock.jsfailed: 
STDOUT:

STDERR:
/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/vc_server_deps/internal/parse_yarn_lock.js:145
        let referrer = dependency.referrer;
                                 ^

TypeError: Cannot read property 'referrer' of undefined
    at Object.keys.forEach.name (/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/vc_server_deps/internal/parse_yarn_lock.js:145:34)
    at Array.forEach (native)
    at nodes.forEach (/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/vc_server_deps/internal/parse_yarn_lock.js:134:39)
    at Array.forEach (native)
    at breakCircularDependencies (/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/vc_server_deps/internal/parse_yarn_lock.js:124:9)
    at main (/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/vc_server_deps/internal/parse_yarn_lock.js:46:3)
    at Object.<anonymous> (/private/var/tmp/_bazel_rohan/704e4959b45a6871701648c93ca35942/external/vc_server_deps/internal/parse_yarn_lock.js:7:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
 and referenced by '//:server-module'.
ERROR: Analysis of target '//:server-module' failed; build aborted: Loading failed.
INFO: Elapsed time: 11.235s

The protobuf.js library installs fine when using this library from commit dc9f8ba73f007a5eb3e57668e77082188c1ce219.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions