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

option oneof=unions causing error Cannot read properties of undefined (reading 'name') #480

Closed
yl2chen opened this issue Jan 18, 2022 · 5 comments · Fixed by #481
Closed
Labels

Comments

@yl2chen
Copy link

yl2chen commented Jan 18, 2022

Using following versions:

  • protoc: 3.19.1
  • ts-proto: 1.102.0
  • ts-proto-descriptors: 1.4.0

With options:

  • --ts_proto_opt=oneof=unions

We are seeing the following error

FAILED!Cannot read properties of undefined (reading 'name')TypeError: Cannot read properties of undefined (reading 'name')
    at generateOneofProperty (/usr/local/share/.config/yarn/global/node_modules/ts-proto/build/main.js:479:77)
    at /usr/local/share/.config/yarn/global/node_modules/ts-proto/build/main.js:457:29
    at Array.forEach (<anonymous>)
    at generateInterfaceDeclaration (/usr/local/share/.config/yarn/global/node_modules/ts-proto/build/main.js:451:23)
    at /usr/local/share/.config/yarn/global/node_modules/ts-proto/build/main.js:60:21
    at /usr/local/share/.config/yarn/global/node_modules/ts-proto/build/visit.js:25:9
    at Array.forEach (<anonymous>)
    at Object.visit (/usr/local/share/.config/yarn/global/node_modules/ts-proto/build/visit.js:19:14)
    at Object.generateFile (/usr/local/share/.config/yarn/global/node_modules/ts-proto/build/main.js:59:13)
    at /usr/local/share/.config/yarn/global/node_modules/ts-proto/build/plugin.js:22:37--ts_proto_out: protoc-gen-ts_proto: Plugin failed with status code 1.
@yl2chen
Copy link
Author

yl2chen commented Jan 19, 2022

@stephenh any help here would be greatly appreciated!

@stephenh
Copy link
Owner

@yl2chen yeah, sorry about that; if you pin to ts-proto-descriptors 1.3.1 (and make sure to not sure ^1.3.1 but just 1.3.1 to pick that specific version), then things should work again.

cc @Vilsol fyi/shoot...

stephenh pushed a commit that referenced this issue Jan 19, 2022
## [1.102.1](v1.102.0...v1.102.1) (2022-01-19)

### Bug Fixes

* Pin ts-proto-descriptors to 1.3.1. ([#481](#481)) ([6f362bf](6f362bf)), closes [#480](#480)
@stephenh
Copy link
Owner

🎉 This issue has been resolved in version 1.102.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@andreasnomikos
Copy link

Thanks so much for the quick turnaround.

@yl2chen
Copy link
Author

yl2chen commented Jan 19, 2022

Great thank you!

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

Successfully merging a pull request may close this issue.

3 participants