Style sheet doesn't load on some pages
Describe the bug A clear and concise description of what the bug is. The style tag sometimes has a media="x" attribute, making it not load.
To Reproduce Steps to reproduce the behavior:
- Use nextra with bun.
- Make a few pages.
- Run using next.
- See that sometimes, a page has no styles.
Expected behavior A clear and concise description of what you expected to happen.
Style sheet never has media="x"
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS 15
- Browser Arc
- Version latest
More details I only used turborepo and bun to test, but it shouldn't change the result.
Please provide reproduction 🙏
Not sure if this helps but when I see this behavior, deleting the .next folder and re-running seems to fix this. 🤷♂️
Ok, it fixed itself 😵💫. However, I think it's still worth it to investigate a bit into why this is happening, as it's quite annoying. I've searched for media="x" in this repo, and it didn't show up. Maybe it's one of the dependencies doing the chaos?
I thought I had narrowed it down when only refreshing the top level document, "Homepage," was getting rid of the css. When I created a new file called test at the top level though, it stopped happening entirely?
I had a similar problem. To reproduce write on cli pnpm add next react react-dom nextra nextra-theme-blog.
What I did was downgrading Nextra to v2.
@carlosrsabreu please provide runnable reproduction, if you need help with fixing your issue
For anyone having this issue here is a fix https://github.com/shuding/nextra/issues/3461#issuecomment-2414525010 by @87xie
Docs were updated to require _app.jsx because I had problems in Next.js 15 rc1 without it I couldn't build app
https://nextra.site/docs/docs-theme/start#create-nextjs-app-component https://nextra.site/docs/blog-theme/start#create-nextjs-app-component
@dimaMachina
I've encountered this issue as well. In the development environment, I see the following screen. It seems to occur randomly on either /ko or /en routes.
To reproduce in the development environment:
- Clone the suspensive repository
- Run
pnpm install - Execute
pnpm build - Start the dev server with
pnpm --filter=suspensive.org dev
I've checked this comment, but it wasn't a viable solution in my case as I'm already using _app.tsx.
Nextra 4 is released https://the-guild.dev/blog/nextra-4
So closing this issue which was related to Nextra 3