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

Importing google/protobuf/empty.proto after akkaserverless/annotations.proto causes google.protobuf.Empty to not be found #222

Open
jroper opened this issue Dec 7, 2021 · 0 comments
Labels
bug Something isn't working javascript-sdk kalix-runtime Runtime and SDKs sub-team

Comments

@jroper
Copy link
Member

jroper commented Dec 7, 2021

This is clearly a bug in pbjs, but in my project, when I do this:

import "google/protobuf/empty.proto";
import "akkaserverless/annotations.proto";

It works, but if I change the order:

import "akkaserverless/annotations.proto";
import "google/protobuf/empty.proto";

I get this:

$ npm run build

> [email protected] build /home/jroper/src/akkaserverless-iot/home-management
> akkasls-scripts build && npm run lint-check && tsc

Compiling protobuf descriptor with command: /home/jroper/src/akkaserverless-iot/home-management/node_modules/.bin/compile-descriptor /home/jroper/src/akkaserverless-iot/home-management/proto/home_management.proto
Compiling descriptor with command: /home/jroper/src/akkaserverless-iot/home-management/node_modules/@lightbend/akkaserverless-javascript-sdk/protoc/bin/protoc --include_imports --proto_path=/home/jroper/src/akkaserverless-iot/home-management/node_modules/@lightbend/akkaserverless-javascript-sdk/proto --proto_path=/home/jroper/src/akkaserverless-iot/home-management/node_modules/@lightbend/akkaserverless-javascript-sdk/protoc/include --descriptor_set_out=user-function.desc --include_source_info --proto_path=/home/jroper/src/akkaserverless-iot/home-management/proto /home/jroper/src/akkaserverless-iot/home-management/proto/home_management.proto
Building static Javascript definitions from proto with command: /home/jroper/src/akkaserverless-iot/home-management/node_modules/.bin/pbjs /home/jroper/src/akkaserverless-iot/home-management/proto/home_management.proto -t static -o /home/jroper/src/akkaserverless-iot/home-management/lib/generated/proto.js
/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/cli/pbjs.js:246
            throw err;
            ^

Error: no such type: google.protobuf.Empty
    at Service.lookupType (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/namespace.js:383:15)
    at Method.resolve (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/method.js:157:45)
    at Service.resolveAll (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/service.js:111:20)
    at Namespace.resolveAll (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/namespace.js:308:25)
    at Namespace.resolveAll (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/namespace.js:308:25)
    at Namespace.resolveAll (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/namespace.js:308:25)
    at Root.resolveAll (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/namespace.js:308:25)
    at Root.resolveAll (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/src/root.js:258:43)
    at Object.main (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/cli/pbjs.js:237:48)
    at Object.<anonymous> (/home/jroper/src/akkaserverless-iot/home-management/node_modules/protobufjs/bin/pbjs:4:16)

/home/jroper/src/akkaserverless-iot/home-management/node_modules/@lightbend/akkasls-scripts/bin/akkasls-scripts.js:182
    throw `${actionDescription} failed.`;
    ^
Building static Javascript definitions from proto failed.
(Use `node --trace-uncaught ...` to show where the exception was thrown)
@jroper jroper added bug Something isn't working kalix-runtime Runtime and SDKs sub-team labels Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript-sdk kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

No branches or pull requests

2 participants