This app was migrated from Create React App (CRA) to Vite for a faster dev experience while keeping the existing codebase and libraries intact.
- React (current project version)
- Redux + Thunk
- React Router v5
- Material‑UI v4
- Vite (dev/build)
pnpm installpnpm dev- Opens on
http://localhost:5173 - Entry file:
index.html→/src/main.jsx
pnpm build- Output directory:
dist/
pnpm preview- Serves
dist/locally
- If you see a blank screen, check the browser console for runtime errors first.
- Some privacy/ad‑block extensions may block Firebase Analytics in dev. Disable them for
localhost, or guard analytics to only run in production. - Chrome warning "Unrecognized feature: 'browsing-topics'" is harmless and can be ignored in dev.
The API https://course-api.com/react-store-products may block localhost:5173 due to CORS. Use a Vite dev proxy and call the path instead of the full URL:
vite.config.js
export default defineConfig({
plugins: [react()],
server: {
proxy: {
"/react-store-products": {
target: "https://course-api.com",
changeOrigin: true,
secure: true,
},
},
},
});- Replace fetch URL in code (example):
fetch("/react-store-products");- "Blocked by client" loading Firebase scripts: ad‑block extension; disable for
localhostor guard analytics for prod only. - ReactDOM.findDOMNode error with React 19: some older libs (e.g., MUI v4, certain carousels) still use
findDOMNode. Use React 18 to avoid it, or upgrade those libs if staying on React 19.
pnpm dev– start Vite dev serverpnpm build– build with Vitepnpm preview– preview production build
├── index.html # Vite entry HTML
├── vite.config.js # Vite configuration
├── src/
│ ├── main.jsx # React entry (mounts <App />)
│ ├── App/ # App shell and routing
│ ├── Pages/ # Feature pages
│ ├── shared/ # Shared components & utilities
│ ├── store/ # Redux store, reducers, actions
│ └── assets/ # Static assets
└── package.json # Scripts and dependencies
- Clear Vite cache if needed:
rm -rf node_modules/.vite - Restart dev server after config changes.
- Share the first console error for targeted help.