#Problem with React + Electron + Vite build (empty window)

4 messages · Page 1 of 1 (latest)

flat quarry
#

Hey, I just built an electron-react app for the first time with npm run build but the app is completely empty but the index.css works because I can see it in the web tools. Seems like the react components or the App.jsx doesn't load because no errors in . It all worked fine when running on the editor, it's just the build version.
this is my package.json btw

{
  "name": "test-v0-1",
  "private": true,
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build && electron-builder",
    "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.21.3"
  },
  "devDependencies": {
    "@types/react": "^18.0.37",
    "@types/react-dom": "^18.0.11",
    "@typescript-eslint/eslint-plugin": "^5.59.0",
    "@typescript-eslint/parser": "^5.59.0",
    "@vitejs/plugin-react": "^4.0.0",
    "electron": "^24.4.0",
    "electron-builder": "^23.6.0",
    "eslint": "^8.38.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.3.4",
    "typescript": "^5.0.2",
    "vite": "^4.3.2",
    "vite-plugin-electron": "^0.11.2",
    "vite-plugin-electron-renderer": "^0.14.5"
  },
  "main": "dist-electron/main.js"
}
unborn gate
#

Hello, you can read this

flat quarry
#

Tyvm! and yes, I am using React Router so it should bc of that, I'll check

#

Yep. Changing BrowserRouter to HashRouter fixed it, thanks once again