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

Bad state: No element #871

Closed
peterweb2005 opened this issue Aug 22, 2023 · 3 comments · Fixed by #879
Closed

Bad state: No element #871

peterweb2005 opened this issue Aug 22, 2023 · 3 comments · Fixed by #879
Labels

Comments

@peterweb2005
Copy link

$ protoc --version
libprotoc 24.1

$ protoc --dart_out=. {xxx}.proto
Unhandled exception:
Bad state: No element
#0 List.last (dart:core-patch/growable_array.dart:348:5)
#1 toDartComment (package:protoc_plugin/src/shared.dart:52:16)
#2 FileDescriptorProtoExt.commentBlock (package:protoc_plugin/src/shared.dart:24:14)
#3 MessageGenerator.generateFieldAccessorsMutators (package:protoc_plugin/src/message_generator.dart:539:34)
#4 MessageGenerator.generateFieldsAccessorsMutators (package:protoc_plugin/src/message_generator.dart:521:7)
#5 MessageGenerator.generate. (package:protoc_plugin/src/message_generator.dart:428:7)
#6 IndentingWriter._addBlockBodyAndEnd (package:protoc_plugin/indenting_writer.dart:101:9)
#7 IndentingWriter.addAnnotatedBlock (package:protoc_plugin/indenting_writer.dart:94:5)
#8 MessageGenerator.generate (package:protoc_plugin/src/message_generator.dart:327:9)
#9 FileGenerator.generateMainFile (package:protoc_plugin/src/file_generator.dart:275:9)
#10 FileGenerator.generateFiles (package:protoc_plugin/src/file_generator.dart:234:24)
#11 CodeGenerator.generate. (package:protoc_plugin/src/code_generator.dart:131:36)

@peterweb2005
Copy link
Author

seems about comments

after removed all comments, no errors

@njooma
Copy link

njooma commented Aug 24, 2023

I'm seeing the same issue as well. I can't remove comments from the protos as I don't own them (I'm using buf to grab the proto definitions).

Downgrading from 21.1.x back down to 21.0.2 works for now.

@osa1 osa1 added the bug label Oct 9, 2023
osa1 added a commit to osa1/protobuf.dart that referenced this issue Oct 9, 2023
@osa1 osa1 closed this as completed in #879 Oct 9, 2023
osa1 added a commit that referenced this issue Oct 9, 2023
@osa1
Copy link
Member

osa1 commented Oct 10, 2023

Bug fix released with protoc_plugin 21.1.2.

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