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: client.gql is not a function

See original GitHub issue

Bug report


$ keystone-next build
✨ Building Keystone
✨ Generating Admin UI code
✨ Generating Keystone config code
✨ Building Admin UI
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info  - Skipping validation of types  
info  - Creating an optimized production build  
info  - Compiled successfully
info  - Collecting page data ..TypeError: client.gql is not a function
    at Object.<anonymous> (/Users/sidalitemkit/work/web/ysana/kysana-pql/node_modules/@keystone-next/keystone/dist/admin-meta-graphql-1e30b380.cjs.dev.js:5:40)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/Users/sidalitemkit/work/web/ysana/kysana-pql/node_modules/@keystone-next/keystone/admin-ui/context/dist/keystone.cjs.dev.js:17:24)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Describe the bug

When building error !

To Reproduce


"@babel/runtime": "^7.15.4",
    "@emotion/core": "^11.0.0",
    "@graphql-tools/merge": "^8.1.2",
    "@keystone-next/admin-ui": "^15.0.0",
    "@keystone-next/document-renderer": "^4.0.0",
    "@keystone-next/types": "^25.0.0",
    "@types/react": "^17.0.21",
    "apollo-server-micro": "^3.3.0",
    "graphql": "^15.5.3",
    "graphql-tag": "^2.12.5",
    "next": "11.1.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "@keystone-ui/core": "^3.2.0",
    "@keystone-ui/fields": "^4.1.3",
    "@keystone-ui/icons": "^4.0.1",
    "@keystone-ui/tooltip": "^4.0.2",
    "@preconstruct/next": "^3.0.0",
    "@keystone-next/auth": "^32.0.0",
    "@keystone-next/cloudinary": "^7.0.0",
    "@keystone-next/fields-document": "^9.0.0",
    "@keystone-next/keystone": "^25.0.3"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dbehmoarascommented, Apr 28, 2022

@dbehmoaras could you please post steps to reproduce the problem?

At the moment I can’t provide a detailed reproduction - we are quite slammed at the moment. When I have time after our next release I will try. What I can share is that this only occurs for us in unit tests and thankfully not in our dev environment.

That said, after digging in further it’s very likely an issue with Apollo and not Keystone. For the moment we are skipping those unit tests and covering them in integration tests.

1reaction
timlesliecommented, Sep 20, 2021

This is now fixed in @apollo/client version 3.4.13 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-apollo gql, TypeError: Object(...) is not a function
This seems like a known issue - see here. Try installing graphql-tag and importing gql from this library.
Read more >
TypeError: Object(...) is not a function - Help - Apollo GraphQL
Hello,. I am trying to migrate from the old apollo packages. I migrated and install @graphql/client and updated my code to only rely...
Read more >
react-apollo gql, TypeError: Object(...) is not a function-Reactjs
[Solved]-react-apollo gql, TypeError: Object(...) is not a function-Reactjs ... This seems like a known issue - see here. Try installing graphql-tag and importing ......
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,...
Read more >
definitions.trim is not a function when using gql tag with ...
[…] apollo-codegen can parse your .tsx or .js files and find and extract any gql tags, but one thing it cannot do is...
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