Open
Description
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.27.0
Plugin version
10.0.1
Node.js version
20.12.2
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
When using this plugin with TypeScript the socket within the handler isn't typed correctly because it reexports WebSocket.WebSocket
from ws
which isn't listed as a dependency.
app.get('/new-status-route', {websocket: true}, async (socket, req) => {
// socket is any instead of WebSocket.WebSocket
Therefore it's necessary to install it additionally.
I think the typical solution would be listing it in dependencies
rathern than devDependencies
.
Link to code that reproduces the bug
No response
Expected Behavior
The plugin also installs @types/ws
which leads to the correct type of socket
within the handler.
Metadata
Metadata
Assignees
Labels
No labels