Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid mode for astro SSR does not prerender pages on Mac #1989

Closed
1 task done
LunaticMuch opened this issue Jun 10, 2024 · 5 comments
Closed
1 task done

Hybrid mode for astro SSR does not prerender pages on Mac #1989

LunaticMuch opened this issue Jun 10, 2024 · 5 comments

Comments

@LunaticMuch
Copy link

What version of starlight are you using?

0.23.4

What version of astro are you using?

4.10.1

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Edge

Describe the Bug

Astro seems not able to pre-render pages in a hybrid environment.
According to the manual, astro pages are always pre-rendered which should make it compatible with an hybrid installation.
However, using such config leads to no starlight page pre-rendered. All other astro pages, outside starlight, are prerendered. I found this noticing that during the build, pagefind was not finding any html page.

output: "hybrid",
  adapter: nodejs({
    mode: "standalone",
}),

Without the hybrid mode:

 generating static routes 
12:52:26 ▶ @astrojs/starlight/404.astro
12:52:26   └─ /404.html (+8ms)
12:52:26 ▶ src/pages/schema/[...slug].astro
12:52:26   ├─ /schema/1/index.html (+6ms)
12:52:26   ├─ /schema/2/index.html (+4ms)
12:52:26   └─ /schema/3/index.html (+4ms)
12:52:26 ▶ @astrojs/starlight/index.astro
12:52:26   ├─ /guides/example/index.html (+4ms)
12:52:26   ├─ /index.html (+14ms)
12:52:26   └─ /reference/example/index.html (+4ms)
12:52:26 ✓ Completed in 62ms.

and with the hydrid mode enabled:

 prerendering static routes 
12:52:54 ▶ src/pages/schema/[...slug].astro
12:52:54   ├─ /schema/1/index.html (+13ms)
12:52:54   ├─ /schema/2/index.html (+3ms)
12:52:54   └─ /schema/3/index.html (+3ms)
12:52:54 ✓ Completed in 35ms.

I am working to a reproducible example. The one on Stackblitz seems to work, but the exact same repo on my local macbook M3 does not.

Link to Minimal Reproducible Example

https://stackblitz.com/~/github.com/LunaticMuch/fuzzy-giggle

Participation

  • I am willing to submit a pull request for this issue.
@HiDeoo
Copy link
Member

HiDeoo commented Jun 10, 2024

Thanks for your report.

Is this the exact same repro you're testing or something similar? I'm asking because I just tried downloading the repro and building it on macOS and did not get the issue you're seeing.

The only change I made was removing the ../../assets/houston.webp mention in src/content/docs/index.mdx as I assume it's just an asset missing in StackBlitz.

I used the "Download ZIP" button in the file explorer to download the repro and ran npm install and npm run build as the configuration already contained output: "hybrid", and the Node.js adapter.

If you re-download the repro and try again, does it still fail for you?

@LunaticMuch
Copy link
Author

LunaticMuch commented Jun 10, 2024

It's the same one running from my local.
I built it because I have another repo which actually behave bizarrely in the same way. Only difference, I locally used a company proxy for downloading dependencies instead of the public npm registry.

I actually tried to reproduce it locally, using npmjs.org as registry, and I have it. This is way too weird.

@LunaticMuch
Copy link
Author

If you re-download the repro and try again, does it still fail for you?

Yes, I actually tried also from my own macbook...same issue. Do you know how could I potentially debug/trace it?

@LunaticMuch
Copy link
Author

I think it's an astro related problem. I will open a bug there. Right now you can look the following logs for MacOS and Codesandbx

Same repo, different behaviour. The only real difference is the underlying OS.

@LunaticMuch
Copy link
Author

Problem identified. Not a Starlight problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants