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.

Can't make it work with HAPI

See original GitHub issue

Hello, I can’t make it work with HAPI (version 20).

I’m following the documentation :

const server: Server = hapiServer({
    host,
    (...)
})

await server.register({
  plugin: rTracer.hapiPlugin
})    

 (other plugins, routes, ...)

And in a route :

handler: (request: Request, h: ResponseToolkit) => {
  const requestId = rTracer.id()
  console.log(`requestId: ${requestId}`)

rTracer.id() always returns undefined

By debugging in rtracer.js, I can see that I enter als.enterWith with a generated id, but when the route handler is called als.getStore() alwasy returns undefined

What am I missing ?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
QuentinFarizoncommented, Oct 7, 2021
1reaction
QuentinFarizoncommented, Oct 7, 2021

Thanks for your quick reply !

Your sample works, so I will have to disable other plugins and routes to find what’s the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't access payload during auth strategy #4164 - hapijs/hapi
This allows auth schemes that rely on the payload to do some of their work after the payload is processed and available. Another...
Read more >
Cannot up the basic sever written with hapi.js - Stack Overflow
I followed their getting started guide, installed hapi and put code that is required to spin up a basic server, inside index. js...
Read more >
Routing - hapi.dev
When defining a route in hapi, you need three basic elements: the path, the method, and a handler. These are passed to your...
Read more >
hapi — How to Fix AssertionError, Cannot validate HEAD or ...
In this tutorial, you'll walk through the steps to fix the assertion “Cannot validate HEAD or GET requests”. hapi Series Overview. hapi ...
Read more >
Seven Secrets to a Happy ADHD Relationship
Sometimes you can't even remember where you went, what you did, and who you were ... As you can see, he is working...
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