Internal TypeScript errors after 3.4.3 upgrade
See original GitHub issueIntended outcome: No TypeScript errors in the project.
Actual outcome:
After upgrading from @apollo/client
v3.3.21 to v3.4.3 our project now reports the following TypeScript errors:
$ ../node_modules/.bin/tsc --noEmit
node_modules/apollo-link/lib/link.d.ts:15:56 - error TS2709: Cannot use namespace 'Observable' as a type.
15 request(operation: Operation, forward?: NextLink): Observable<FetchResult> | null;
~~~~~~~~~~
node_modules/apollo-link/lib/link.d.ts:17:79 - error TS2709: Cannot use namespace 'Observable' as a type.
17 export declare function execute(link: ApolloLink, operation: GraphQLRequest): Observable<FetchResult>;
~~~~~~~~~~
node_modules/apollo-link/lib/linkUtils.d.ts:12:50 - error TS2709: Cannot use namespace 'Observable' as a type.
12 export declare function toPromise<R>(observable: Observable<R>): Promise<R>;
~~~~~~~~~~
node_modules/apollo-link/lib/linkUtils.d.ts:14:62 - error TS2709: Cannot use namespace 'Observable' as a type.
14 export declare function fromPromise<T>(promise: Promise<T>): Observable<T>;
~~~~~~~~~~
node_modules/apollo-link/lib/linkUtils.d.ts:15:56 - error TS2709: Cannot use namespace 'Observable' as a type.
15 export declare function fromError<T>(errorValue: any): Observable<T>;
~~~~~~~~~~
node_modules/apollo-link/lib/types.d.ts:32:58 - error TS2709: Cannot use namespace 'Observable' as a type.
32 export declare type NextLink = (operation: Operation) => Observable<FetchResult>;
~~~~~~~~~~
node_modules/apollo-link/lib/types.d.ts:33:83 - error TS2709: Cannot use namespace 'Observable' as a type.
33 export declare type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;
~~~~~~~~~~
How to reproduce the issue:
Run ../node_modules/.bin/tsc --noEmit
inside a project using @apollo/client
v3.4.3
Versions
System:
OS: macOS 11.4
Binaries:
Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
Browsers:
Chrome: 92.0.4515.107
Firefox: 89.0.2
Safari: 14.1.1
npmPackages:
@apollo/client: 3.4.3 => 3.4.3
apollo-link-rest: ^0.8.0-beta.0 => 0.8.0-beta.0
typescript: 4.3.5
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How to resolve compile errors during upgrade of Angular ...
I tried deleting everything inside the node_modules folder and running “npm install”. One thing that is strange is that my current Typescript ......
Read more >Documentation - TypeScript 3.8
error ! A type-only import can specify a default import or named bindings, but not both. In conjunction with import type , TypeScript...
Read more >Getting started - Bootstrap
You can also install and manage Bootstrap's Less, CSS, JavaScript, and fonts using Bower: ... More specifically, it includes the following and more:....
Read more >Highlights - create-react-app - Breword 文档集合
npm install --save --save-exact react-scripts@3.4.3 ... If you're using TypeScript, you will need to upgrade your typescript dependency to 3.7.0 or later if ......
Read more >Known upgrading issues and solutions - Joomla! Documentation
Backend/Page Break PHP error after upgrade to Joomla 3.5.1 ... In Joomla 3.4.2 and 3.4.3 some JavaScript files were updated which causes an...
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
Hi i have installed typescript 4.4.2 and resolved this issue.
I can confirm this happened on our side too.
Initially I thought that for some reason node_modules wan’t excluded when running
npx tsc --noEmit
, unfortunately that is not the case.