Skip to content

unusable PizzaServiceClient code generated by rollup.js in //test:test_es6_bundling #67

@ztl8702

Description

@ztl8702

Description

The generated code of target //test:test_es6_bundling fails to resolve grpc-web-client properly.

Errors seen

The generated code of target //test:test_es6_bundling contains a suspecious undefined():

PizzaServiceClient.prototype.orderPizza = function orderPizza(requestMessage, metadata, callback) {
  if (arguments.length === 2) {
    callback = arguments[1];
  }
  var client = undefined(PizzaService.OrderPizza, { // huh????
    request: requestMessage,
    host: this.serviceHost,
    metadata: metadata,

which means the methods on PizzaServiceClient will throw:

TypeError: undefined is not a function�[0m
  Stack:
        at <Jasmine>
        at PizzaServiceClient.grpc.unary (node_modules/rules_typescript_proto/test/proto/pizza_service_pb_service.mjs:33:16)
        at UserContext.<anonymous> (test/rollup_test.spec.js:33:29)
        at <Jasmine>
        at processImmediate (internal/timers.js:439:21)

Minimal Reproduction

See test cases in #66.

# checkout PR #66
bazel test //test:rollup_test

Notably, I added similar test cases to both pizza_service_proto_test.spec.ts and rollup_test.spec.js. Only the latter (//test:rollup_test) failed. So it should be a Rollup.js related issue.

Your Environment

What operating system are you using?

macOS (the issue seems to be platform-independent)

What version of bazel are you using?

Build label: 2.0.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 19 12:33:30 2019 (1576758810)
Build timestamp: 1576758810
Build timestamp as int: 1576758810

What version of the library are you using?

PR #66, based off recent master

Any other comments?

Likely related: #64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions