question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Cannot use `dateIn` as an input for a middleware

See original GitHub issue

Another small bug my team discovered:

Right now, it’s not possible to define a middleware with a dateIn input. Calling an endpoint using such a middleware always results in a <field_name>: Expected string, received date error.

I didn’t have time to look into the source code here, but it seems like inputs might be parsed/validated multiple times (once at the middleware and then again at the endpoint), and by the time they’re checked for the second time the date string has already been parsed to a date (which is not the expected input type of dateIn). Could that be the case?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
shroudedcodecommented, Oct 28, 2022

Awesome, thank you so much! 🙌

1reaction
RobinTailcommented, Oct 28, 2022

Ok, thank you for the code sample. I will check it soon, @shroudedcode

Read more comments on GitHub >

github_iconTop Results From Across the Web

Presence of middleware prevents access to raw request ...
Describe the Bug. When attempting to upload a file over a few kilobytes (e.g. sending a POST request with a binary body and...
Read more >
Full Stack Error Handling with GraphQL and Apollo
Errors can range from bad user inputs to back-end bugs to rare network outages. Since it's at the center of all the action,...
Read more >
Cannot app.use(multer). "requires middleware function" error
I'm just starting learning NodeJS and I am stuck with a problem. I would like to upload files to ...
Read more >
Known Issues for Oracle SOA Products 12.1.3
Workaround: Log in to Oracle Enterprise Manager Fusion Middleware Control using the exact case sensitivity with which you created the user in Oracle...
Read more >
How to validate if input date (end date) in input field must be ...
Use the validation name(validateInputField) in the routes as a middleware as an array of validations. Destructure 'validationResult' function ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found