Nest: Incorrect import of @types/socket.io

Created on 15 Mar 2018  路  6Comments  路  Source: nestjs/nest

I'm submitting a bug report


[ ] 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

/@nestjs/websockets/adapters/io-adapter.d.ts is not importing socket.io correctly. It is a bus with new version of @types/socket.io package

Environment


Nest version: 4.6.6
Socket.io: 2.0.4
@types/socket.io: 1.4.32

Most helpful comment

yarn add @types/[email protected] fixed the problem because 1.4.32 typings are broken.

All 6 comments

I too am getting a compilation error,

node_modules/@nestjs/websockets/adapters/io-adapter.d.ts(14,27): error TS2503: Cannot find namespace 'SocketIO'.
node_modules/@nestjs/websockets/adapters/io-adapter.d.ts(16,35): error TS2503: Cannot find namespace 'SocketIO'.

if i swap out /// <reference types="socket.io" /> for import * as SocketIO from 'socket.io' it compiles, but changing node_modules is a very ephemeral fix, so hopefully i'm just missing something else

I think it is not a NestJS error. See here: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24330

yarn add @types/[email protected] fixed the problem because 1.4.32 typings are broken.

1.4.33 (latest) also works

@nestjs/websocket: 5.0.1
@types/socket.io: 1.4.36

don't fix

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

artaommahe picture artaommahe  路  3Comments

thohoh picture thohoh  路  3Comments

anyx picture anyx  路  3Comments

hackboy picture hackboy  路  3Comments

rlesniak picture rlesniak  路  3Comments