window.__VITE_REACT_SSG_HASH__ (read by every route's data loader to fetch static-loader-data-manifest-<hash>.json) is set by a plain inline <script> placed later in the document body. With script: 'async', the module script in <head> can start executing as soon as it finishes downloading, racing ahead of the HTML parser reaching that later inline script — intermittently reading the hash as undefined depending on network/cache timing, and producing a 404 on .../static-loader-data-manifest-undefined.json followed by a React hydration crash (error #418). 'defer' guarantees the module only executes after the full document, including that inline script, has been parsed — this removes the race structurally rather than just making it less likely.
React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and Oxlint's TypeScript related rules in your project.