google/protobuf.dart

Bad state: No element

peterweb2005 opened this issue · 3 comments

$ 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)

seems about comments

after removed all comments, no errors

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 commented

Bug fix released with protoc_plugin 21.1.2.