-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Description
Hi!
Following the Nuxt tutorial (https://socket.io/how-to/use-with-nuxt) and as a follow-up on this ( #5323 ) unanswered discussion, I think the following line/variable _query should be made optional:
| _query: Record<string, string>; |
Since handleRequest() in:
socket.io/packages/engine.io/lib/server.ts
Line 758 in 07cbe15
| this.prepare(req); |
calls prepare(), which sets the _query field even if it doesn't exist yet:
socket.io/packages/engine.io/lib/server.ts
Lines 734 to 740 in 07cbe15
| private prepare(req: EngineRequest) { | |
| // try to leverage pre-existing `req._query` (e.g: from connect) | |
| if (!req._query) { | |
| const url = new URL(req.url, "https://socket.io"); | |
| req._query = Object.fromEntries(url.searchParams.entries()); | |
| } | |
| } |
And my editor currently complains about the types mismatch after completing the above mentionned tutorial:
Thanks in advance!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels