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

req.query is undefined #251

Closed
2 tasks done
Worldwidebrine opened this issue Apr 19, 2023 · 2 comments
Closed
2 tasks done

req.query is undefined #251

Worldwidebrine opened this issue Apr 19, 2023 · 2 comments

Comments

@Worldwidebrine
Copy link

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.15.0

Plugin version

7.2.0

Node.js version

v18.16.0

Operating system

Windows

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

10.0.22621

Description

req.query is undefined.
req.request.query is the query but TypeScript thinks req.request doesn't exist.

Steps to Reproduce

fastify.get("*", {...}, (conn, req) => {
    console.log(req.query);
    console.log(req.request.query);
});
undefined
Empty <[Object: null prototype] {}> { test: 'abc' }

Expected Behavior

No response

@mcollina
Copy link
Member

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

@Worldwidebrine
Copy link
Author

Oh. I forgot to await fastify.register(websocket)

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