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

TypeError: Cannot read property 'length' of undefined when no matching route handler #29

Closed
ErisDS opened this issue Jan 27, 2022 · 1 comment · Fixed by #30
Closed
Labels
bug Something isn't working released

Comments

@ErisDS
Copy link
Collaborator

ErisDS commented Jan 27, 2022

When using reqresnext, if you try to make a request for an endpoint or method that doesn't match a route handler, instead of a 404 you'll get this error:

TypeError: Cannot read property 'length' of undefined    
      at unpipe (node_modules/unpipe/index.js:47:12)
      at send (node_modules/finalhandler/index.js:306:3)
      at node_modules/finalhandler/index.js:133:5
      at Function.handle (node_modules/express/lib/application.js:170:5)
      at app (node_modules/express/lib/express.js:39:9)
      at Object.<anonymous> (src/test/js/express.js:20:7)

express falls back to finalhandler in this case, and finalhandler tries to call unpipe()

ErisDS added a commit to ErisDS/reqresnext that referenced this issue Jan 27, 2022
closes antongolub#29

- this adds a new type of test showing what happens when req and res are used in conjunction with express
- added a noop for unpipe, which fixes the broken test
ErisDS added a commit to ErisDS/reqresnext that referenced this issue Jan 27, 2022
closes antongolub#29

- this adds a new type of test showing what happens when req and res are used in conjunction with express
- added a noop for unpipe, which fixes the broken test
ErisDS added a commit to ErisDS/reqresnext that referenced this issue Jan 27, 2022
closes antongolub#29

- this adds a new type of test showing what happens when req and res are used in conjunction with express
- added a noop for unpipe, which fixes the broken test
antongolub pushed a commit that referenced this issue Jan 27, 2022
closes #29

- this adds a new type of test showing what happens when req and res are used in conjunction with express
- added a noop for unpipe, which fixes the broken test
@antongolub
Copy link
Owner

🎉 This issue has been resolved in version 1.6.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@antongolub antongolub added released bug Something isn't working labels Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants