Skyleen77 / next-nprogress-bar

NProgress integration on Next.js compatible with /app and /pages folders
https://next-nprogress-bar.vercel.app
315 stars 24 forks source link

Error: navigation.usePathname is not a function #58

Closed begalinsaf closed 5 months ago

begalinsaf commented 5 months ago

can you help me with this error

Error: navigation.usePathname is not a function

im in Nextjs 14.2.2 intalled with Bun

hideyuki commented 5 months ago

@begalinsaf Same issue It may be necessary to use it only for the client component

Please try to put 'use client' on top of the code that uses the ProgressBar tag

bick commented 5 months ago

@hideyuki @begalinsaf I was able to fix this when working with the layout.tsx file is you need to use the Second approach wrap in a use client Providers component.

Docs here (scroll down): https://www.npmjs.com/package/next-nprogress-bar#exemple-with-applayout

begalinsaf commented 5 months ago

I've done all the configuration for the app router, including 'use client' on the provider, but I don't know what's causing the issue. Maybe there's a conflict between my code and this package, but for now, I'm using nextjs-toploader. I'll close this issue. Thank you, everyone.

f-steel commented 2 months ago

had the same issue as you and also now using the other package @begalinsaf