apollographql / apollo-client

:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
https://apollographql.com/client
MIT License
19.4k stars 2.66k forks source link

Error while build the angular app with SSR #11591

Open dnyaneshwar871992 opened 9 months ago

dnyaneshwar871992 commented 9 months ago

I'm getting below error while building the application with angular SSR,

Angular 10 Typescript - 4.0.2

Error stack is,

ERROR in node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:19 - error TS1005: ']' expected. 5 [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K]; ~~ node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:22 - error TS1005: ';' expected. 5 [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K]; ~ node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:25 - error TS1128: Declaration or statement expected. 5 [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];


node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:44 - error TS1005: '(' expected.
5     [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];
                                             ~
node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:52 - error TS1005: ',' expected.
5     [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];
                                                     ~
node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:55 - error TS1005: ',' expected.
5     [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];
                                                        ~
node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:56 - error TS1135: Argument expression expected.
5     [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];
                                                         ~
node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:5:62 - error TS1005: ')' expected.
5     [K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];
                                                               ~
node_modules/@apollo/client/utilities/types/OnlyRequiredProperties.d.ts:6:1 - error TS1128: Declaration or statement expected.
6 };
  ~

Please help.
phryneas commented 9 months ago

Hi @dnyaneshwar871992!

The problem is probably that you are using TypeScript 4.0 - that's an extremely outdated version of TypeScript, and TypeScript has since introduced a lot of new syntax that cannot be parsed by that old version.