nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Style sheet doesn't load on some pages

Open realhackcraft opened this issue 1 year ago • 8 comments

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:

  1. Use nextra with bun.
  2. Make a few pages.
  3. Run using next.
  4. 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.

Screenshot 2024-10-02 at 18 04 07 Screenshot 2024-10-02 at 18 04 34

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.

realhackcraft avatar Oct 03 '24 15:10 realhackcraft

Please provide reproduction 🙏

dimaMachina avatar Oct 03 '24 19:10 dimaMachina

Not sure if this helps but when I see this behavior, deleting the .next folder and re-running seems to fix this. 🤷‍♂️

jimmy-guzman avatar Oct 03 '24 21:10 jimmy-guzman

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?

realhackcraft avatar Oct 04 '24 02:10 realhackcraft

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?

realhackcraft avatar Oct 04 '24 02:10 realhackcraft

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 avatar Oct 08 '24 11:10 carlosrsabreu

@carlosrsabreu please provide runnable reproduction, if you need help with fixing your issue

dimaMachina avatar Oct 08 '24 14:10 dimaMachina

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 avatar Oct 17 '24 14:10 dimaMachina

@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.

image

To reproduce in the development environment:

  1. Clone the suspensive repository
  2. Run pnpm install
  3. Execute pnpm build
  4. 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.

kangju2000 avatar Oct 17 '24 17:10 kangju2000

Nextra 4 is released https://the-guild.dev/blog/nextra-4

So closing this issue which was related to Nextra 3

dimaMachina avatar Jan 30 '25 23:01 dimaMachina