-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] yarn pnpify tsc can not resolve some graphql types #271
Comments
I believe this is a https://cdn.jsdelivr.net/npm/apollo-server-plugin-base@0.5.6/package.json |
How this was working before? 🤔 |
My guess is that some other package depended on |
|
It is advised that packages never depend to their Since Apollo packages don't require a type dependency it's a bit different. I am not sure what is the right thing to do here. Installing Maybe TypeScript should have a concept of "type dependencies" and Yarn can install those if TypeScript is involved... |
IMO, generally speaking, the @types packages should list peer dependencies, not regular dependencies. This has been my stance for quite some time:
In the particular case of Apollo, it seems like things should work better with using a regular dependency (because unless I'm mistaken it doesn't export global symbols; if it did then a peer dependency would be safer).
We have an experimental TypeScript plugin that would be the perfect ground for such things (right now it simply auto-adds the corresponding @types packages when you add something else). Of course it wouldn't work with npm 🤷♀️ |
I'll close this issue as it seems caused by an improper dependency listing in the Apollo package. |
@arcanis Does this related to apollographql/apollo-server#3222 ? My theory is that
I do have the first two because I'm using it. Since Yarn flattened all dependencies on the tree, I also have Update: |
Describe the bug
See my PR trying to use P'n'P on this simple project that uses TypeScript and Webpack:
mohsen1/apollo-react-async-ssr#3
I get errors like the following.
note
Environment:
Additional context
tsc does pass with the code in master.
The text was updated successfully, but these errors were encountered: