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

Error when using with Express v5 #47

Open
IAmVisco opened this issue Jan 24, 2025 · 2 comments
Open

Error when using with Express v5 #47

IAmVisco opened this issue Jan 24, 2025 · 2 comments

Comments

@IAmVisco
Copy link

IAmVisco commented Jan 24, 2025

When using with Express v5 you get an error like

TypeError: Cannot set property query of #<IncomingMessage> which has only a getter
    at expressJoiValidator (...\node_modules\express-joi-validation\express-joi-validation.js:81:21)

Which leads here
I assume it happens due to sanitization. Anything that can be done about it? Thanks.

@evanshortiss
Copy link
Owner

Seems like the query object has changed per express 5.x migration docs. I guess it might be necessary to change this module's behaviour to set a new validatedQuery or similar on req. Not ideal, since this is a breaking change.

WDYT?

@IAmVisco
Copy link
Author

IAmVisco commented Feb 1, 2025

If possible, I'd love to see a major release supporting Express v5. It's not going to be widely adopted for a long time, but I've seen people (myself included) tinker with it on pet projects.

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