Repository navigation
fix(site): ship React with the server so the image starts - #27
Merged
Merged
Conversation
Recharts reaches React through use-sync-external-store, which loads it with require(). The server bundle left that require unresolved, so the Docker image, which has no node_modules beside its output, failed every request with "Cannot find module 'react'" and never became healthy. Nitro now traces react and react-dom into the output, so every part of the Site uses that one copy.
The test pressed Ctrl+K before the page had attached its shortcut, so the palette sometimes never opened. It now presses again until the palette is shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
v0.2.0 deployed, but the Site's new container never replaced the old one, so commitscape.damnlabs.com kept serving 0.1.1.
The v0.2.0 Site image answers every request,
/api/healthincluded, with a 500:Recharts, new in 0.2.0, reaches React through
react-redux→use-sync-external-store, which loads it withrequire("react"). The bundle leaves thatrequireto run at run time. In the repo and in CI's e2e there is anode_modulesbeside the output, so it resolves; the image has only/app/.output, so it fails. The health check never passes and Dokploy keeps the previous container.The fix
apps/site/vite.config.ts: Nitro now tracesreactandreact-dominto.output/server/node_modules, so therequirefinds them and every part of the Site uses that one copy.apps/site/e2e/foundation.spec.ts: the repository page test pressed Ctrl+K before the page listened for it, which failed CI onmainfor the 0.2.0 commit. It now presses again until the palette is shown.Checked
/api/healthand never becomes healthy.pnpm checkpasses. The Card PNG timing test went over its 200 ms limit once on a loaded machine and passed on its own (33 of 33).pnpm e2e: 58 of 58. The fixed test passed 8 of 8 when repeated.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.