Fix: build the SPA on install so /draw isn't 'Page not found'#21
Merged
Conversation
The Vue SPA's two outputs — www/draw.html and public/frontend/ — are git-ignored build artifacts generated by `yarn build` (the frappe-ui vite plugin's buildConfig writes both). Nothing triggered that build on install, because the app had no root-level package.json. So a fresh `bench get-app draw` / Frappe Cloud deploy had NO www/draw.html at all, and visiting <site>/draw returned Frappe's "Page not found" 404 (reported by @asoral). Fix: add a root package.json mirroring the pattern every Frappe SPA app uses (drive, helpdesk, gameplan, insights) — postinstall: cd frontend && yarn install # bench pulls frontend deps build: cd frontend && yarn build # bench build compiles the SPA `bench build` (run on every Frappe Cloud deploy and self-hosted install) now runs the app's build script, generating www/draw.html + assets. Verified: from a clean tree (both artifacts deleted) `bench build --app draw` regenerates the SPA and /draw serves again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Confidence Score: 5/5Single-file addition that wires up the standard Frappe SPA build hook; no logic changes, no risk of regression. This adds exactly one file with three scripts that delegate to the existing frontend build. The pattern is battle-tested across multiple Frappe apps, and the change has no effect on any existing code path. No files require special attention. Reviews (1): Last reviewed commit: "Fix: build the SPA on install/deploy so ..." | Re-trigger Greptile |
This was referenced Jul 20, 2026
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.
The bug (reported by @asoral)
Visiting
<site>/drawon a fresh install returns Frappe's "Page not found."Root cause
The SPA's outputs —
draw/www/draw.htmlanddraw/public/frontend/— are git-ignored build artifacts produced byyarn build(via the frappe-ui vite plugin'sbuildConfig). The app had no root-levelpackage.json, so nothing ran that build during install/deploy. A freshbench get-app draw(or Frappe Cloud deploy) therefore had nowww/draw.htmlat all, and/drawhad nothing to serve → 404.Fix
Add a root
package.jsonmirroring the pattern every Frappe SPA app uses (Drive, Helpdesk, Gameplan, Insights):{ "scripts": { "postinstall": "cd frontend && yarn install", "build": "cd frontend && yarn build" } }bench build— run on every Frappe Cloud deploy and self-hosted install — now invokes the app'sbuildscript and generates the SPA.Verified
From a clean tree with both artifacts deleted (simulating a fresh clone):
bench build --app draw→ regenerateswww/draw.html+public/frontend/assets/*and/drawserves again. ✅This also makes Frappe Cloud installs turnkey.
🤖 Generated with Claude Code