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

Regenerating protobuf bindings fails #3

Open
paulcadman opened this issue Jan 10, 2025 · 0 comments
Open

Regenerating protobuf bindings fails #3

paulcadman opened this issue Jan 10, 2025 · 0 comments

Comments

@paulcadman
Copy link

I'm having some trouble regenerating the protobuf ts/js/ts declaration (.d.ts) files:

Here's what I tried (after copying the new protobuf dir from $ANOMA/anoma/apps/anoma_protobuf/priv/protobuf to the repo.

npm install
./scripts/generate.sh

I get an error:

protoc-gen-js: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--js_out: protoc-gen-js: Plugin failed with status code 1.

I then tried setting:

--plugin="protoc-gen-js=${PROTOC_GEN_JS_PATH}"

in the generate.sh (setting PROTOC_GEN_JS_PATH to the appropriate path in node_modules/.bin)

The script then runs but it doesn't generate the TS declaration .d.ts files. So when I run the example:

npx ts-node src/example.ts

I get the error:

.npm/_npx/1bf7c3c15bf47d04/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/example.ts:2:24 - error TS2307: Cannot find module './protobufs/intents/intent_pb' or its corresponding type declarations.

2 import { Intent } from "./protobufs/intents/intent_pb";
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Am I following the right steps to generate the new grpc-js output?
Am I running src/example.ts in the recommended way?

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

1 participant