Next.js Discord

Discord Forum

TypeError: Cannot destructure property 'auth' of 'urlObj' as it is undefined.

Answered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
Hello, I'm having this error on almost every page of my code. The error doesn't seem to be caused by the page I'm using but rather by some configuration or something in the global scope. I've been trying to remove some components to find the error but without success. I'm looking for someone who knows where this could be generated, the documentation hasn't helped me much so far. I'm open to suggestions!
Answered by Asian black bear
Resolved, I had Providers with routes that weren't available before authentication, basically a logic error.

I managed to identify it by commenting out all the Providers within the _App.
View full answer

11 Replies

Asian black bearOP
@joulev Search your codebase, do you have `urlObj` anywhere?
Asian black bearOP
Interestingly not, this might be caused by some third-party library, specifically NextUI.
@Asian black bear Interestingly not, this might be caused by some third-party library, specifically NextUI.
Hmm. Remove parts of the code until the error goes away, you will get to see which part causes the error. Which part is it?
@joulev Hmm. Remove parts of the code until the error goes away, you will get to see which part causes the error. Which part is it?
Asian black bearOP
That's what I'm doing right now, removing components and libraries. It seems to be a quite obscure error.
Yeah errors like this are frustrating to deal with but there isn’t much else that we can do
Asian black bearOP
People had this error in previous versions of Next when using Link without href, but that's not the case in my code. I think this might be associated with routes that require authorization. I'm simply removing these routes one by one to test each of them.
I'll let this open fo awhile until i find the error to share it here.
Asian black bearOP
Resolved, I had Providers with routes that weren't available before authentication, basically a logic error.

I managed to identify it by commenting out all the Providers within the _App.
Answer
Asian black bearOP
FIXED
ty @joulev