TypeError: (0 , _client.makeVar) is not a function
See original GitHub issueIntended outcome: Upgraded from 3.4.11 to 3.4.12 and tried to run tests and expected everything go smoothly because there shouldn’t be any breaking changes.
Actual outcome: Got this failure:
● Test suite failed to run
TypeError: (0 , _client.makeVar) is not a function
when importing makeVar
like it is suggested in the docs (https://www.apollographql.com/docs/react/local-state/reactive-variables/):
import { makeVar } from '@apollo/client'
Got it working by changing the import to:
import { makeVar } from '@apollo/client/cache'
but then I ran into different issues (https://github.com/apollographql/apollo-client/issues/8814)
How to reproduce the issue: import makeVars:
import { makeVar } from '@apollo/client'
Versions
System:
OS: macOS 11.6
Binaries:
Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 7.22.0 - ~/.nvm/versions/node/v14.17.6/bin/npm
Browsers:
Chrome: 93.0.4577.82
Edge: 93.0.961.52
Firefox: 91.0.2
Safari: 14.1.2
npmPackages:
@apollo/client: 3.4.12 => 3.4.12
apollo-link-logger: 2.0.0 => 2.0.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:12 (3 by maintainers)
Top Results From Across the Web
React Apollo Client useQuery Hook gql Uncaught TypeError ...
But the defined query const of will return me an error which is: Uncaught TypeError:(...) is not a function and thus the page...
Read more >Reactive variables - Apollo GraphQL Docs
This code creates a reactive variable with an empty array as its initial value. Important: The return value of makeVar is a function...
Read more >Pitfalls I fell into during Apollo Client 3.0 migration
Recently I worked on migrating Apollo Client to 3.0 from 2.6 in our project. ... with an error message saying TypeError:(0, _client.gql) is...
Read more >gql TypeError: Object(...) is not a function - Code Grepper
gql TypeError: Object(...) is not a function. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On March 17, 2020...
Read more >apollo-client - Awesome JS
A fully-featured, production ready caching GraphQL client for every UI framework ... Fix various flaky tests before publishing @apollo/client@v3.7.0-rc.0 by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue with
gql
.gql
is undefined debugging it in our jest tests.Sample Code
Still getting this issue when testing with Jest. Apollo Client Version : 3.5.10,