Open noveyak opened 4 years ago
I have also reproduced this, here's a minimal example: https://github.com/AndiDog/protobufjs-identifier-already-declared
I've also hit this issue and had to switch to 6.9.0 to resolve.
Note: If you make use of protobuf3 optional
fields, downgrading to 6.9 is not an option, because support was only added in 6.11.
protobuf.js version: 6.10.1
Expected behavior
pbjs should generate javascript free of syntax errors when using wrap = es6
Actual behavior
If there are 2 map fields in a protobuf message, pbjs generates code that redeclares let which is a SyntaxError. This did not happen in version 6.9.0
Code
Resulting javascript -
end2
is declared twice, incase 1
andcase 2
but the case statements are not wrapped in bracketsJavascript using protobufjs 6.9.0