Looking for assistance with my React app. I made a decision to incorporate Vite into my React application to address some performance issues after the initial development.
Everything is functioning smoothly in my local environment; however, once deployed on Heroku, all I see is a blank page. Any help would be greatly appreciated. Here is a snippet from my package.json
:
Frontend:
"scripts": {
"start": "serve -s build",
"dev": "vite",
"build": "tsc && vite build",
"test": "vite test",
"eject": "vite eject",
"preview": "vite preview"
}
Backend:
"scripts": {
"data:import": "ts-node ./src/models/seeder.model.ts",
"data:destroy": "ts-node src/models/seeder.model.ts -d",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node dist/server.js",
"postinstall": "tsc ",
"tsc": "./node_modules/typescript/bin/tsc",
"watch-node": "nodemon dist/server.js",
"server": "nodemon ./src/server.ts ",
"client": "npm start --prefix fa-shop",
"watch-ts": "tsc -w",
"deploy": "git add . && git commit -m Heroku && git push heroku main",
"heroku-postbuild": " npm install --prefix fa-shop && npm run build --prefix fa-shop",
"dev": "concurrently \"npm run server\" \"npm run client \" "
}
Here is how the folders are organized:
appBackend --
-- node_modules/backend
-- frondend
--- node_modules/frontend
View of Heroku deployment https://i.sstatic.net/13DyR.png