Skip to content
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

Type error with apollo client package #11131

Closed
SaumilNagariya opened this issue Aug 8, 2023 · 4 comments · Fixed by #11134
Closed

Type error with apollo client package #11131

SaumilNagariya opened this issue Aug 8, 2023 · 4 comments · Fixed by #11134

Comments

@SaumilNagariya
Copy link

Issue Description

Hi team,

We are using node v18.16.1 and apollo-client 3.8.0 for Nexjs Commerce repo. It was working fine till yesterday, but now it is failing the build.

Yarn build

image

can you please help me asap?

Link to Reproduction

n/a

Reproduction Steps

No response

@jerelmiller
Copy link
Member

Hey @SaumilNagariya 👋

Could I get a little more info from you. When you say "working fine till yesterday", were you using a prerelease version of 3.8? If so, which one?

Not much has changed between the rc.2 version and the public release version so I'm a bit surprised to see this. Do you have a reproduction that we can dig into further?

@alessbell
Copy link
Contributor

What versions of Next.js and TypeScript are you using? I've tried to reproduce this with no luck so far.

I've cloned the latest https://github.com/vercel/commerce project, pnpm installed @apollo/[email protected] and imported + called useBackgroundQuery in a client component. (For streaming SSR support, you'd want to use our https://www.npmjs.com/package/@apollo/experimental-nextjs-app-support package when using Next.js's app router, but that isn't material to this bug occurring during the build.)

As you can see here, it passes linting and type checking but later fails to generate static pages because I don't have API keys for a Shopify store in my env variables:

CleanShot 2023-08-08 at 12 13 14

@alessbell
Copy link
Contributor

In the meantime, you can try the snapshot release from #11134 by doing npm i @apollo/[email protected].

This subtly changes the import syntax in the built useBackgroundQuery.d.ts:

- import { type QueryReference } from "../cache/QueryReference.js";
+ import type { QueryReference } from "../cache/QueryReference.js";

But I'd be very curious to look at a reproduction since AFAIK the syntax we're currently using has been supported since TypeScript 4.5.

@jerelmiller jerelmiller added the 🏓 awaiting-contributor-response requires input from a contributor label Aug 14, 2023
@alessbell alessbell self-assigned this Aug 28, 2023
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants