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

error TS1005: '?' expected - in apollo client v 3.5.10 #11313

Closed
bkrajendra opened this issue Oct 23, 2023 · 5 comments
Closed

error TS1005: '?' expected - in apollo client v 3.5.10 #11313

bkrajendra opened this issue Oct 23, 2023 · 5 comments

Comments

@bkrajendra
Copy link

Issue Description

I am using apollo client v 3.5.10
currently facing issue with jenkins build:
error:

[INFO] Error: node_modules/@apollo/client/cache/core/types/common.d.ts:52:110 - error TS1005: '?' expected.
[INFO] 
[INFO] 52 type StoreObjectValueMaybeReference<StoreVal> = StoreVal extends Array<infer Item extends Record<string, any>> ? ReadonlyArray<AsStoreObject<Item> | Reference> : StoreVal extends Record<string, any> ? AsStoreObject<StoreVal> | Reference : StoreVal;

Everything was working till few days back and suddenly started getting this issue.
there is no change in build environment.

maven buil env:

<nodeVersion>v14.17.0</nodeVersion>
<npmVersion>6.14.13</npmVersion>

package.json

"@apollo/client": "^3.5.10",
"typescript": "4.6.2",

what could be the issue?

Link to Reproduction

NA

Reproduction Steps

No response

@phryneas
Copy link
Member

phryneas commented Oct 23, 2023

I'm very sorry to say that, but you are working with a very outdated environment and all your tools and libraries are years behind and unsupported by their respective maintainers at this point.

You are using the caret (^) version for Apollo Client, so ^3.5.10 includes every 3.x version higher than that - it doesn't really tell us which version of Apollo Client you currently have installed. It could even be the current 3.8.6 version.

There is a good chance that some part of your build environment is not able to parse a newer release of Apollo Client as there might e.g. newer TypeScript syntax in there that might not be supported by the TypeScript version you have installed. Your best chance is probably to slowly increase your other tooling versions until it works again.

@bkrajendra
Copy link
Author

Thanks for the quick reply.
For now temporary fix I applied is to use "@apollo/client": "3.5.10" (removed ^)
But we will definitely have to upgrade to the latest version of the library.
Thanks again.

@phryneas
Copy link
Member

Just keep in mind that doing this could also mean that you e.g. accidentally downgraded from 3.7.12 to 3.5.10 - you don't know which version you really were on.
I'd recommend that you look at the git history of your package-lock.json to find that out.

@phryneas
Copy link
Member

Either way, I think there's nothing really actionable from our side, so I'm closing this issue. I hope you get this resolved as good as possible :)

alfetopito added a commit to cowprotocol/explorer that referenced this issue Oct 31, 2023
Something in our setup is outdated and is not compatible with the latest @apollo/client version

See apollographql/apollo-client#11313 for a similar situation

This reverts commit 74f214c.
alfetopito added a commit to cowprotocol/explorer that referenced this issue Nov 1, 2023
Something in our setup is outdated and is not compatible with the latest @apollo/client version

See apollographql/apollo-client#11313 for a similar situation

This reverts commit 74f214c.
alfetopito added a commit to cowprotocol/explorer that referenced this issue Nov 1, 2023
Something in our setup is outdated and is not compatible with the latest @apollo/client version

See apollographql/apollo-client#11313 for a similar situation

This reverts commit 74f214c.
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 Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants