-
Notifications
You must be signed in to change notification settings - Fork 75
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
Issue generating code with v2.0 #957
Comments
Similar problems happened to me as well. I just started using the lib and connect, but no types were working and generated ts seemed very odd to me (types were values and so on). For me the solution was to get the previous version (1.10.0), cause they introduced "breaking" changes) |
"I think they released protoc-gen-es 2.0.0 for all their old versions", what do you mean by that? Cause I just also made some tests with bun (I am not using node for this project) and it did install previous version. At least if you understood you correctly, it doesn't make any sense |
Thats super strange honestly. |
Hey, everyone, hopefully I can help sort out the issues here. First, a v2.0.0 was released for the following packages:
However, no v2 for any @Evilu in your protoClass example, it looks like you are using the remote plugin for
|
that did the trick!
gave me protoc-gen-es 2.0.0 no matter the version the the pacakge.json and this one:
seems to do the trick (And I say this carefully before I tested the whole api, but at least it gave me files generated with protoc-gen-es 1.1.3) I have to say that this is quite strange behavior and deserves to be investigated. |
Yeah this is because you're using a remote plugin to generate your code which is completely independent of the plugin version you've specified in your package.json. If you were using a local plugin to generate the code, then they would be the same because when running generate, it would look in your path for the plugin executable. When generating code remotely, it uses the executable version you've specified in your buf.gen.yaml. If you do not specify a version, then it pulls the latest plugin version available at the time of generating. You actually do not even need to have More on code generation here. |
@Evilu going to close this issue, but feel free to reopen if you see other issues. FWIW, we plan to address this for the future so that users aren't inadvertently broken when a new major plugin version is released. |
Thanks for the help, everything is much clearer now. |
Hi,
version 2.0.0 broke my app completely, now each response throwing me the
"TS2693: xxResponse only refers to a type, but is being used as a value here." error.
In the generated type in service_pb_d.ts file it says:TS2344: Type string does not satisfy the constraint.
any clue?
EDIT:
here is an example:
document.proto:
document_service.proto:
buf.gen.yaml:
api:
documents.ts:
EDIT2:
apparently downgrade is not possible.
i was trying to use last version
package.json:
npm cache clean --force && npm install
and still the code seems to be generate by v2.0.0, so i'm pretty stuck.
The text was updated successfully, but these errors were encountered: