-
Notifications
You must be signed in to change notification settings - Fork 68
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
Missing dependency declaration for @bufbuild/protobuf #432
Comments
similarly, i tried to get connect web working in my project and everything installed fine without @bufbuild/protobuf but type inference was broken |
Just a friendly reminder… This is still a problem with |
I added this to the "opt:" list in buf.yaml, and things started working. Maybe it'll help here too? |
@kubijo I haven't been able to recreate this issue with Yarn v3 and below. I did notice you're using an RC of Yarn 4, though. Can you provide some additional information?
|
The latest yarn node ./bin/protoc.js --version
libprotoc 22.0
The whole script is rather lengthy, but it can be summarized thusly: # https://github.com/bufbuild/protobuf-es/tree/main/packages/protoc-gen-es#with-protoc
PATH="$(dirname "$(yarn bin protoc-gen-es)"):$PATH"
# https://github.com/bufbuild/connect-web/tree/main/packages/protoc-gen-connect-web#with-protoc
PATH="$(dirname "$(yarn bin protoc-gen-connect-es)"):$PATH"
export PATH
yarn node "$DIR_ROOT/bin/protoc.js" \
--es_out="${DIR_PROTO_OUT}" \
--es_opt="target=ts,import_extension=.js" \
--connect-es_out="${DIR_PROTO_OUT}" \
--connect-es_opt="target=ts,import_extension=.js" \
--proto_path="${DIR_PROTO_INP}" \
"${files[@]}"
I believe that the command used to be I have tried just now with these versions and the results were as mentioned already.
frontend ❯ yarn set version latest
➤ YN0000: Downloading https://repo.yarnpkg.com/3.4.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.4.1.cjs
➤ YN0000: Done in 0s 138ms frontend ❯ yarn set version canary
➤ YN0000: Retrieving https://repo.yarnpkg.com/4.0.0-rc.39/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.0.0-rc.39.cjs
➤ YN0000: Done in 0s 568ms Both resulted in this (among other output):
The simple fact is, though, that you do import This will work with NPM and other lenient package managers because Why you haven't been able to reproduce the issue is a mystery to me… However, I am certain that just adding the dependency will resolve this since that is what yarn does when you use the |
Thanks for the info. And yeah, I understand what you're saying. The reason I'm asking is because I'm curious why some of our tests and examples (that use Yarn PnP) didn't catch this problem. The fix makes sense, I just don't know why I can't recreate it. |
Yeah man, it confuses me too... Possibly someone from yarn team would be of help... I find them being extremely helpful and willing to help. |
@smaye81 I can reproduce it too. JFYI :) |
I was able to reproduce it too. There was a few things wrong with our Yarn project. @fubhy stamped your PR. Thank you for the fix. |
@smaye81 Do you have an idea when I can expect a release? Not that it's particularly holding me back… I'd just like to clean my configs & get a feeling for your releasing policies… Oh, and thanks for the kind responses & prompt fix 👍 |
Hopefully releasing this today! Stay tuned. EDIT: Apologies for the delay @kubijo. Working out a few more things internally before the release. Might be looking at sometime tomorrow. |
@smaye81 Sadly, there seems to be a regression with Example import being: import { createGrpcWebTransport } from '@bufbuild/connect-web'; It did work with |
Oh, I see you've got that already in #514... never mind then |
Apologies. Just published v0.8.2-1 of the affected packages.
Let's call it aggressive bundle size optimization 😆 |
Your sense of humour is not lost on me nor misplaced for these kinds of things 😉 |
Describe the bug
Running this plugin in context of Yarn V3 with enabled PNP mechanism produces the following error:
but adding the following section to
.yarnrc.yml
resolves the issueEnvironment (please complete the following information):
@bufbuild/protoc-gen-connect-web
: 0.6.0Additional context
The text was updated successfully, but these errors were encountered: