next-axiom icon indicating copy to clipboard operation
next-axiom copied to clipboard

TypeError: Cannot read properties of undefined (reading '_log')

Open lumenwrites opened this issue 2 years ago • 3 comments

Sometimes I'm seeing a popup that looks like this: Screen Shot 2022-08-31 at 17 12 29

Screen Shot 2022-08-31 at 17 13 23

And there's no way for me to know where this error is coming from, or what's causing this.

There should probably be a more meaningful error message that would help people understand what's going on.

But meanwhile - can you help me figure out how to find the source of the problem and fix it?

lumenwrites avatar Aug 31 '22 16:08 lumenwrites

Hmm... Looks like this is triggered when an axios request throws any kind of error. So this line triggers it:

    await axios.post("123", {})

Very weird and unexpected. If there's no await in front of axios, this error doesn't pop up.

Either way, whatever's going on with this issue, that makes it extremely difficult to debug things.

lumenwrites avatar Aug 31 '22 17:08 lumenwrites

hmm, this is weird. not sure whats happening, but I am guessing when axios throws an error, next-axiom captures that and tries to send the log to axiom, but somehow this context in our logger becomes undefined. which next-axiom version are you using?

dasfmi avatar Sep 01 '22 09:09 dasfmi

@lumenwrites I tried to reproduce the issue by using axios to call an invalid url, but I saw a normal 404 error. can you maybe provide an example that could reproduce the issue or some insight on your setup.

dasfmi avatar Sep 01 '22 13:09 dasfmi

@lumenwrites haven't heard back from you for a while, I will close this issue now but please let me know if this is still happening. thx.

dasfmi avatar Feb 09 '23 09:02 dasfmi