Closed nandorojo closed 5 months ago
https://github.com/apal21/nextjs-progressbar/blob/master/src/index.tsx#L87-L93
Here's the problem.
is your issue related to https://github.com/apal21/nextjs-progressbar/issues/70#issuecomment-1061533686?
Not sure, that comment isn’t that clear. I don’t think so. It’s just because the object containing shallow can be undefined but the handler in this library treats it as required.
My PR fixes it
according to nextjs docs, the object containing shallow will be always there so there's no need to pass a default, check https://nextjs.org/docs/pages/api-reference/functions/use-router#routerevents
The comment I link is for the same issue but it was caused by manually emitting this event. If u are manually emitting this event without the 2nd param then it'll throw. So check if the event u are receiving is coming from nextjs or emitted from your code. If it's from your code then add the shallow part in the event emit param
Thanks for the explanation, that's very useful to know. We are using events.emit('routeChangeError')
somewhere without the second argument, so it's likely due to that. My apologies for the incorrect issue.
is your issue related to https://github.com/apal21/nextjs-progressbar/issues/70#issuecomment-1061533686?
Also, small thing, when I originally clicked the comment you linked to on GH mobile, it sent me to a different one higher on the page. Now that I click it on desktop it takes me to yours, which does indeed explain the issue properly. So that's my mistake.
We're getting this after setting
showOnShallow={false}
. I'm guessing there is a missing null check in there.