Skip to content

fix: keep views/dist in place while building (#481) - #589

Open
yetval wants to merge 1 commit into
QuiteAFancyEmerald:masterfrom
yetval:fix/build-keeps-live-dist-481
Open

yetval wants to merge 1 commit into
QuiteAFancyEmerald:masterfrom
yetval:fix/build-keeps-live-dist-481

Conversation

@yetval

@yetval yetval commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #481

As discussed on the issue, this is the fix for the gzip gibberish after a restart.

The build was deleting the live views/dist folder while it ran, so a server starting during a build picked up the wrong page loader and kept serving it until the next restart. The build now leaves the current folder in place and only swaps in the new one at the end.

Tested with the real build and server: restarting during a build now gives normal pages instead of gibberish, and the build output is unchanged.

@QuiteAFancyEmerald

Copy link
Copy Markdown
Owner

How are you testing this? I am unable to get the same result when I test on my production server (hence why I haven't merged)

@yetval

yetval commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Hey, thanks again for testing!
I think the difference is that / always looks fine because it re-reads from disk, so the bad loader only shows up on routes like /browsing etc try that?

curl -s http://127.0.0.1:8080/browsing | od -An -tx1 -N4
# 1f 8b 08 00 = bad which is compressed/raw response
# 3c 21 64 6f = good "<!do"

I tested by starting the build and backend.js at the same time, like pnpm start. On 5 runs, master returned the bad bytes every time, while this PR returned the correct HTML bytes.

If you’re still seeing gibberish on the PR, could you run that curl while it’s happening? That should help narrow down what’s different on your side.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Force restarting creates maximum GZIP gibberish (Nginx)

2 participants