Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Websocket Types: TS1259 because "ws" package using "export =" #283

Closed
2 tasks done
bstka opened this issue Dec 20, 2023 · 0 comments
Closed
2 tasks done

Fix Websocket Types: TS1259 because "ws" package using "export =" #283

bstka opened this issue Dec 20, 2023 · 0 comments

Comments

@bstka
Copy link
Contributor

bstka commented Dec 20, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.21.0

Plugin version

8.5.10

Node.js version

18.17.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

Pop_os! 22.04

Description

Before fixing this bug, fastify.websocketServer it doesnt have any resolved auto completion/types in vscode, when I open the type definition it throw error TS1259, because ws package use export = Websocket.

I fix this issue when I change import WebSocket from "ws" to import * as WebSocket from "ws" directly in node_modules/@types/fastify-websocket or in this repo type definition

Steps to Reproduce

hovering fastify.websocketServer and open node_modules/@types/fastify-websocket/index.d.ts

Expected Behavior

Expected resolved type definition and autocomplete in vscode

@bstka bstka mentioned this issue Dec 20, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants