Skip to content
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

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

Closed
ztl8702 opened this issue Jan 21, 2020 · 2 comments

Comments

@ztl8702
Copy link

ztl8702 commented Jan 21, 2020

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

@ztl8702
Copy link
Author

ztl8702 commented Jan 21, 2020

(I will try going backwards in commit history and figure out when it started to break)

@Dig-Doug
Copy link
Owner

It's undefined because rollup can't find unary. Closing as a duplicate of #64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants