Static output always writes `foo.html`, so trailing-slash URLs 404 on hosts like GitHub Pages
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript, vite
- Domain
- build-system, devops
Research direction
Start with packages/void/src/prerender-render.ts, especially outputFileForPath, and compare its current path mapping with the GitHub Pages behavior described in the issue. Review the dev server's trailing slash redirect and the interaction with cloudflare.assets.html_handling in issue #580 before proposing the setting. Done means the output option, redirect behavior, and Cloudflare interaction have a documented and agreed direction.
Written by the indexing model from the issue text.
Description
What happens
With output: 'static', every prerendered page except / is written as <path>.html (outputFileForPath in packages/void/src/prerender-render.ts). A section with an index page and child pages, such as
pages/posts/index.island.tsx
pages/posts/hello.md
builds to
dist/client/posts.html
dist/client/posts/hello.html
There is no option to write posts/index.html instead. Seen with Void 1.3.0; outputFileForPath is unchanged on current main.
Why it matters
The SSG guide says the static output works for self-hosting and covers hosting dist/client/ yourself. GitHub Pages doesn't map a trailing-slash URL to foo.html. I published the same layout on GitHub Pages (honbin/github-pages-trailing-slash, checked on 2026-10-29):
| URL | foo.html layout (Void today) |
foo/index.html layout |
|---|---|---|
/posts |
200 | 301 to /posts/ |
/posts/ |
404 | 200 |
/posts/hello |
200 | 301 to /posts/hello/ |
/posts/hello/ |
404 | 200 |
So with Void's output, every trailing-slash URL except / returns 404, including /posts/, where posts.html sits next to a posts/ directory without an index.html. That breaks any site whose links and canonical URLs end with a slash. Cloudflare resolves both foo.html and foo/index.html (as noted in prerender-render.ts), so this doesn't show up with Void's own deploys.
Current workaround
We move the files in CI after vp build:
find dist/client -name '*.html' ! -name index.html ! -name 404.html | while read -r file; do
mkdir -p "${file%.html}"
mv "$file" "${file%.html}/index.html"
done
Related behavior
The dev server redirects /posts/ to /posts with a 301, so dev assumes URLs without a trailing slash. A directory-style output would probably need the dev redirect to follow the same choice.
Question
Would you be open to an option for directory-style static output (for example, a trailingSlash-like setting next to output: 'static')? Open points I can see:
- the setting's name and where it lives
- whether the dev server redirect follows it
- how it combines with
cloudflare.assets.html_handling(#580)
Happy to send a PR once the direction is clear.
- Dominant language
- TypeScript
- Stars
- 580
- Forks
- 56
- Avg merge
- 11h 32m
- Merged PRs (30d)
- 158
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from voidzero-dev/void
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
voidzero-dev/void#636 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
voidzero-dev/void#635 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
voidzero-dev/void#627 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
voidzero-dev/void#619 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
voidzero-dev/void#606 ·
Maintainers usually reply within 1 day
All issues in voidzero-dev/void
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
lichess-org/lila#22324 · 1 comment ·
Maintainers usually reply within 1 day
-
[Feature Request] [Web] Expose kvCacheQuantizationBits in the onnxruntime-web WebGPU EP optionsOpenep:WebGPU platform:web quantization
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/onnxruntime#33752 ·
Maintainers usually reply within 2 days
-
[Skill Bug]: entra-agent-id: inaccurate blueprint permission inheritance and parent token sub claimOpenbug entra-agent-id
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/GitHub-Copilot-for-Azure#3467 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(worker): keep normal prepare waiting states failure-freePossibly taken @LichKing-2234 claimed this today. Openagent:codex priority:P1
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AgoraIO-Extensions/agent-infra#3745 ·
Maintainers usually reply within 1 day
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framingPossibly taken @Eapp1e claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
makecindy/cindy#7973 · 1 comment ·
Maintainers usually reply within 1 day