pnpm: The inferred type of 'getAllBooks' cannot be named without a reference to '.pnpm/@apollo+client@3.3.15_graphql@15.5.0/node_modules/@apollo/client/core'. This is likely not portable. A type annotation is necessary.

Yes, I dont know what do do, shameful host and https://github.com/pnpm/pnpm/issues/1928#issuecomment-515708856 not really work.

pnpm version: 6.2.1

Code to reproduce the issue:

  • install pnpm i @apollo/client graphql -S

Expected behavior:

not get error

Actual behavior:

image

Additional information:

  • node -v prints: 14.15.0
  • Windows, macOS, or Linux?: Windows

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

https://github.com/microsoft/TypeScript/issues/29808#issuecomment-540292885 Wow, after digging in the typescript, I found that typescript dont know where to find the type of Apollo-angular, so it cannot give a good instruction to vscode. So I dont need to import ApolloQueryResult anymore. If I declare the path of the package on ‘tsconfig.base.json’ my project tsconfig. It work correctly without anything else. So strange, so I guess it is the library bug instead of pnpm bug. I have to admire that it is more perfect than yarn or npm. thank you for a good library. Close the issues since that find the source of problem.

  "apollo-angular": [
        "node_modules/apollo-angular/"
      ],

image

oh, I’m really happy with your answer. I mean it very sad, but at least I know I try my best, and have someone like me. Hahahaha. It already take me 3 days. But at least I’m happy now. thanks for you support. be safe and have a good day