Build Hash For css not match when build using docker
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Router
Describe the bug
Issue
When building a TanStack Start project normally (local build), the asset hashes are consistent and everything works as expected.
However, when building the same project inside a Docker container, there’s a mismatch in the hashed style assets. This causes a Flash of Unstyled Content (FOUC) on page load.
Your Example Website or App
https://github.com/killallskywalker/tanstack-reproduce-issue
Steps to Reproduce the Bug or Issue
- Go to this repository - https://github.com/killallskywalker/tanstack-reproduce-issue
- Run
docker compose up - Open localhost:3000 then you can see the mismatch and the FOUC
However , if you do this
1 . npm run build
2 . node .output/server/index.mjs
3 . Open localhost:3000 then you can see all work nicely
Expected behavior
The asset hashes and generated style files should be identical regardless of build environment (local vs Docker) and no FOUC
Screenshots or Videos
Docker Image -
Local Build -
Platform
- Router / Start Version: [1.135.0]
- Bundler: [vite]
- Bundler Version: [7.2.2]
- Nitro V2 Plugin [1.133.19]
Additional context
Step to reproduce also attach in readme of repo .
Contributor guide
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.
Research direction
Start with the linked tanstack-reproduce-issue repository and run docker compose up, then compare its output with npm run build followed by node .output/server/index.mjs. Inspect how the Vite and Nitro builds generate and reference CSS assets in Docker versus locally. Done means the hashes and generated style files match in both environments and the FOUC is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, typescript, vite
- Domain
- build-system, devops, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100