fix(frontend): migrate CRA→Vite (resolves ajv build failure) + fix scrub-corrupted identifier - #38
Open
OneByJorah wants to merge 1 commit into
Open
fix(frontend): migrate CRA→Vite (resolves ajv build failure) + fix scrub-corrupted identifier#38OneByJorah wants to merge 1 commit into
OneByJorah wants to merge 1 commit into
Conversation
…crub-corrupted identifier - CRA5 react-scripts 5.0.1 build failed with 'Unknown keyword formatMinimum' (schema-utils→ajv-keywords vs nested ajv conflict); unfixable via overrides (8 combos tried). Migrated to Vite 5 (@vitejs/plugin-react). - Fixed scrub-corrupted state init in Settings.js: 'mesh-vpnApiKey: ***' (invalid identifier + redacted value) → 'meshVpnApiKey: ""'. - Vite outputs to build/ (nginx COPY path unchanged); Dockerfile npm ci→install. - docker compose build now GREEN (frontend/backend/ffmpeg all Built).
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.
Problem
The frontend failed
docker compose buildunder Create React App (react-scripts 5.0.1) withError: Unknown keyword formatMinimum— a deep schema-utils→ajv-keywords vs nested ajv version conflict. This is not fixable by dependency overrides (8 combinations attempted: ajv 8.11.0/8.17.1, ajv-formats, ajv-keywords, schema-utils pins, committed lockfiles, node:18 base — all failed). react-scripts is already at its max (5.0.1; CRA is deprecated).Fix
Migrated the build tooling from CRA to Vite 5:
package.json: react-scripts → vite + @vitejs/plugin-react; scripts updated.vite.config.js: React plugin, esbuild JSX loader for.jsfiles (CRA compat), output tobuild/(keeps nginx COPY path), dev/preview on :3000.index.html: moved public/→root, removed%PUBLIC_URL%, added module entry script.Dockerfile:npm ci→npm install; header note CRA→Vite..dockerignore+.gitignorefor node_modules/build.Also fixed (scrub-induced bug)
src/components/Settings.jsline 6 hadmesh-vpnApiKey: ***— a scrub artifact (tailscale→mesh-vpn created an invalid hyphenated JS identifier, and***redacted the value into invalid syntax). Corrected tomeshVpnApiKey: ''.Verification
npm run buildGREEN locally;docker compose buildGREEN (backend/ffmpeg/frontend all Built).