Graphql: TS2307: Cannot find module '@apollo/gateway' or its corresponding type declarations. - came back

Created on 9 Jul 2020  路  5Comments  路  Source: nestjs/graphql

I'm submitting a...


[ ] Regression 
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior


Same error as fixed for #992 found its way back to current release.

"C:\Program Files\nodejs\node.exe" C:\Users\xxx\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js run start:dev
[16:47:50] Starting compilation in watch mode...

node_modules/@nestjs/graphql/dist/interfaces/gql-gateway-module-options.interface.d.ts:1:58 - error TS2307: Cannot find module '@apollo/gateway' or its corresponding type declarations.

1 import { GatewayConfig, ServiceEndpointDefinition } from '@apollo/gateway';
                                                           ~~~~~~~~~~~~~~~~~

node_modules/@nestjs/graphql/dist/interfaces/gql-gateway-module-options.interface.d.ts:2:35 - error TS2307: Cannot find module '@apollo/gateway/src/datasources/types' or its corresponding type declarations.

2 import { GraphQLDataSource } from '@apollo/gateway/src/datasources/types';
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[16:47:56] Found 2 errors. Watching for file changes.

Environment


$ nest info

 _   _             _      ___  _____  _____  _     _____
| \ | |           | |    |_  |/  ___|/  __ \| |   |_   _|
|  \| |  ___  ___ | |_     | |\ `--. | /  \/| |     | |
| . ` | / _ \/ __|| __|    | | `--. \| |    | |     | |
| |\  ||  __/\__ \| |_ /\__/ //\__/ /| \__/\| |_____| |_
\_| \_/ \___||___/ \__|\____/ \____/  \____/\_____/\___/


[System Information]
OS Version     : Windows 10
NodeJS Version : v12.16.3
YARN Version    : 1.22.4

[Nest CLI]
Nest CLI Version : 7.4.1

[Nest Platform Information]
platform-express version : 7.2.0
elasticsearch version    : 7.1.0
passport version         : 7.0.0
graphql version          : 7.5.3
typeorm version          : 7.1.0
common version           : 7.2.0
core version             : 7.2.0

Last working version

v7.5.1

Possible solution

Revert https://github.com/nestjs/graphql/commit/58def406aa412848e5cfea39585e2eb3e0d7477c#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L78

Most helpful comment

@pavankumarkatakam Please make sure to use current NodeJS LTS v12.x.x and Typescript v3.9.x.
I look likes there is an odd side effect when using older versions of NodeJS. Most people get rid of this after updating. See https://github.com/nestjs/graphql/issues/992#issuecomment-654469180.

All 5 comments

Fixed in 7.5.5

Can confirm, it's fixed in v7.5.5. Thanks!

Im still getting this error in 7.5.5 please check below screenshot
nest_error

@pavankumarkatakam Please make sure to use current NodeJS LTS v12.x.x and Typescript v3.9.x.
I look likes there is an odd side effect when using older versions of NodeJS. Most people get rid of this after updating. See https://github.com/nestjs/graphql/issues/992#issuecomment-654469180.

Thank @razorness, after changing the node version to 12 it is working fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moltar picture moltar  路  4Comments

Warchant picture Warchant  路  4Comments

jiayechao picture jiayechao  路  4Comments

danil-z picture danil-z  路  4Comments

liudonghua123 picture liudonghua123  路  3Comments