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:
calls prepare(), which sets the _query field even if it doesn't exist yet:
|
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!
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
_queryshould be made optional:socket.io/packages/engine.io/lib/transport.ts
Line 16 in 07cbe15
Since
handleRequest()in:socket.io/packages/engine.io/lib/server.ts
Line 758 in 07cbe15
calls
prepare(), which sets the_queryfield even if it doesn't exist yet:socket.io/packages/engine.io/lib/server.ts
Lines 734 to 740 in 07cbe15
And my editor currently complains about the types mismatch after completing the above mentionned tutorial:
Thanks in advance!