question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: tsInvariant.setVerbosity is not a function

See original GitHub issue

Just updated from 3.2.5 to latest version to apollo and on local run I get this error:

TypeError: tsInvariant.setVerbosity is not a function
    at Object../node_modules/@apollo/client/core/core.cjs 

I tried to add tsInvariant as dev dependency, but still no luck. Anyway, why I need any ts lib if I use simple React?

 "@apollo/client": "^3.5.4",
  "react": "^16.8.4",

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
evan-sheehancommented, Jan 11, 2022

Fixed my issue per this StackOverflow post: https://stackoverflow.com/questions/70615613/apollo-client-named-export-remove-not-found

In my SvelteKit/Vite project I added this to the svelte.config for the vite config settings: image

I also needed to properly import Apollo client functions via “@apollo/client/core/index.js”. Don’t think this will help OP, but might be useful for someone else.

0reactions
kachkaevcommented, Jul 6, 2022

I also experienced this issue because of ts-invariant@0.4.4 from apollo-server-express. @apollo/client has ts-invariant@0.10.3.

yarn why ts-invariant

=> Found "ts-invariant@0.4.4"
info Has been hoisted to "ts-invariant"
info Reasons this module exists
   - "workspace-aggregator-c9429ed8-aa29-4009-91b3-05901eee841c" depends on it
   - Hoisted from "_project_#@hashintel#hash-api#apollo-server-express#graphql-tools#apollo-link#ts-invariant"
   - Hoisted from "_project_#@hashintel#hash-api#apollo-server-express#graphql-tools#apollo-utilities#ts-invariant"
info Disk size without dependencies: "144KB"
info Disk size with unique dependencies: "224KB"
info Disk size with transitive dependencies: "224KB"
info Number of shared dependencies: 1
=> Found "@apollo/client#ts-invariant@0.10.3"
info This module exists because "_project_#@hashintel#hash-api#@apollo#client" depends on it.
info Disk size without dependencies: "80KB"
info Disk size with unique dependencies: "160KB"
info Disk size with transitive dependencies: "160KB"
info Number of shared dependencies: 1
✨  Done in 0.44s.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo - React (Typescript) Invariant Error when building ...
I added fetch to my code, and it built a production version with no errors. I don't understand why this error was not...
Read more >
ts-invariant - npm
Start using ts-invariant in your project by running `npm i ts-invariant`. There are 194 other projects in the npm registry using ts-invariant.
Read more >
Help for Lift-off part 1 Odyssey course - Apollo Community
"export 'setVerbosity' (reexported as 'setLogVerbosity') was not found in 'ts-invariant'. Kindly advice on this. Cheers, Anguram Shanmugam.
Read more >
Developers - @apollo-client 3.3.2 fails to compile due to ...
@apollo-client 3.3.2 fails to compile due to wrong ts-invariant version resolved. apollostack. 02 December 2020 Posted by eugeneoshepkov. Intended outcome:
Read more >
ts-invariant | Yarn - Package Manager
ts-invariant ... of these methods can be globally reconfigured using the setVerbosity function: ... apollographql/invariant-packages · ts-invariant ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found