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

Don't use __dirname when loading proto/proto.proto #37

Open
stevus opened this issue Nov 11, 2020 · 4 comments
Open

Don't use __dirname when loading proto/proto.proto #37

stevus opened this issue Nov 11, 2020 · 4 comments

Comments

@stevus
Copy link

stevus commented Nov 11, 2020

https://github.com/riemann/riemann-nodejs-client/blob/master/riemann/serializer.js#L17

When bundling, this becomes the directory of the caller, leading to:

(node:17555) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/proto/proto.proto'
@perezd
Copy link
Member

perezd commented Nov 11, 2020

Good find, can you send a PR?

@stevus
Copy link
Author

stevus commented Nov 11, 2020

Sure thing

@stevus
Copy link
Author

stevus commented Jan 4, 2021

@perezd Is using the older .proto format required, or can it be migrated to use the JSON descriptors:

https://www.npmjs.com/package/protobufjs#using-json-descriptors

This would make bundling it easier since the proto.json file can be loaded along with the riemann client js.

@perezd
Copy link
Member

perezd commented Jan 4, 2021

it could support both, but I won't accept a PR that breaks existing usages. Adding support while maintaining the original API would be fine tho.

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