Skip to content

Compile error coming from apollo-server-core/dist/ApolloServer.d.ts #854

@wowczarczyk

Description

@wowczarczyk

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

I am getting the following build error after bumping to 7.3.7:

> nest build

node_modules/apollo-server-core/dist/ApolloServer.d.ts:5:8 - error TS1259: Module '"/Users/dev/proj/node_modules/@types/ws/index"' can only be default-imported using the 'esModuleInterop' flag

5 import WebSocket from 'ws';
         ~~~~~~~~~

  node_modules/@types/ws/index.d.ts:270:1
    270 export = WebSocket;
        ~~~~~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

Found 1 error(s).

Expected behavior

No errors during build

Minimal reproduction of the problem with instructions

I can't reproduce that on a clean nest app, however running npm list apollo-server-core clearly states that the lib causing this error is comming from a dependency of @nestjs/graphql:

├─┬ @nestjs/graphql@7.3.7
│ └─┬ @apollo/gateway@0.14.1
│ └── apollo-server-core@2.13.0
├─┬ apollo-server-cloud-functions@2.13.0
│ └── apollo-server-core@2.13.0
└─┬ apollo-server-express@2.13.0
└── apollo-server-core@2.13.0

Seems that adding skipLibCheck to tsconfig resolves this problem

Environment


Nest version: 7.3.7

 
For Tooling issues:
- Node version: 12.13  
- Platform:  Mac 

Others:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions