Closed IAmYoungbossy closed 2 days ago
Hello everyone,
I was able to find the solution for why the progress bar was not displaying in my Next.js app. The implementation as posted above is fine and should work in your project.
The issue was that the z-index of my header component was higher than the default z-index set on the NProgress element. To resolve this, I had to target the progress bar element with the following CSS rule:
#nprogress .bar {
z-index: 99999 !important;
}
I also updated some of the settings on the ProgressBar component as shown below:
"use client";
import { AppProgressBar as ProgressBar } from "next-nprogress-bar";
const ProgressProvider = ({ children }: { children: React.ReactNode }) => {
return (
<>
{children}
<ProgressBar
height="6px"
shallowRouting
color="#f69446"
options={{ showSpinner: true }}
/>
</>
);
};
export default ProgressProvider;
Another thing I noticed is that most times for your settings to be updated properly, you have to restart your server.
I have resolved the issue on my end. Please feel free to close the issue if you find this solution acceptable. Thank you!
Thank you so much
This is not working in next.js app directory version 14.2.4
This is not working in next.js app directory version 14.2.4
Can you show your implementation process and any error you're getting?
@IAmYoungbossy No error at all. I follow the instruction given above but nothing works.
@IAmYoungbossy No error at all. I follow the instruction given above but nothing works.
Have you checked the z-index
value of your header component to make sure it's not higher than the default z-index
set on NProgressBar? That was the issue I faced too. @acatzk
You can increase the z-index
of your NprogressBar by using the selector below in your CSS file
#nprogress .bar {
z-index: 99999 !important;
}
@IAmYoungbossy No error at all. I follow the instruction given above but nothing works.
Have you checked the
z-index
value of your header component to make sure it's not higher than the defaultz-index
set on NProgressBar? That was the issue I faced too. @acatzkYou can increase the
z-index
of your NprogressBar by using the selector below in your CSS file#nprogress .bar { z-index: 99999 !important; }
Yep Nothing happens
@IAmYoungbossy No error at all. I follow the instruction given above but nothing works.
Have you checked the
z-index
value of your header component to make sure it's not higher than the defaultz-index
set on NProgressBar? That was the issue I faced too. @acatzk You can increase thez-index
of your NprogressBar by using the selector below in your CSS file#nprogress .bar { z-index: 99999 !important; }
Yep Nothing happens
Open your dev tool console, click on the element tab and try to navigate to a different route. While navigating check if the nprogress-busy
class is injected into your html tag as shown below. If it is then one of your element has a higher z-index
than what is set on progressBar element.
If nothing is being injected then check if your ProgressBar provider is imported and used used in your root layout.
I increase the z-index to 99999 in the last version
I have tried to implement this in my project following the documentation but the progress bar doesn't show when navigating between routes.
Below is my ProgressProvider component
It is being imported and used in my RootLayout as shown below, but it's not working. Is there something I'm not doing right?
Any help would be very much appreciated. Thanks