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.

server hangs if a handler returns undefined

See original GitHub issue

with automatic promisifying, if a handler returns undefined, the promise never resolves and the server hangs…

Is there a reason we don’t immediately resolve(undefined) if the handler does?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
pi0commented, Nov 23, 2020

Thanks for repro @danielroe! Actually it helped to find two issues:

  • When using h2 as a sub-app, we should use req.url not originalUrl to allow using relative paths (no /api/js in middleware itself)
  • Since connect detects app.handle, the hanging issue was happening so i made it hidden under app._handle (src)
0reactions
danielroecommented, Nov 22, 2020

For a repro of hang:

  1. Clone https://github.com/danielroe/jiti-h2-tests
  2. yarn && yarn dev
  3. curl http://localhost:3000/api/js/csr - (using h2) hangs
  4. curl http://localhost:3000/api/ts/csr - (using express) succeeds (e.g. falls back to Nuxt 404)

Was trying (and failed) to replicate issue with #13 - but oh well, at least they add a few more tests 🤷‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting back the event handler returns undefined
The onclick property is only going to show you an event handler if it is registered inline via the markup (e.g, <div id="relative" ......
Read more >
One of the module nesting for handler is undefined #1377
Bug Report Current Behavior I'm currently deploying a Remix app with serverless and using serverless-offline to run my app on development ...
Read more >
hapi — How to Fix “handler method did not return a value, a ...
The error message means that you returned undefined or null from your route handler. Hapi v17 expects you to return either a value,...
Read more >
Exploring go net/http: How Server and the Handler structs works.
The first step of the infinite loop is to wait for a net.Conn ( a connection ) via the listener's Accept() function. If...
Read more >
AWS Lambda function handler in Node.js
When your function is invoked, Lambda runs the handler method. ... context) { console.log("EVENT: \n" + JSON.stringify(event, null, 2)) return context.
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