Next.js Discord

Discord Forum

getting a white screen after deploying my vite project on vercel

Unanswered
Turkish Angora posted this in #help-forum
Open in Discord
Turkish AngoraOP
as title suggests my project i working absolutely fie on localhost but am getting a blank screen when i deploy it on vercel

22 Replies

Sun bear
Did you check vercels logs?
@Sun bear Did you check vercels logs?
Turkish AngoraOP
these were the build logs Running build in Washington, D.C., USA (East) – iad1
Retrieving list of deployment files...
Downloading 216 deployment files...
Restored build cache
Running "vercel build"
Vercel CLI 34.2.7
WARN! Due to builds existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
Installing dependencies...
npm WARN reify invalid or damaged lockfile detected
npm WARN reify please re-try this operation once it completes
npm WARN reify so that the damage can be corrected, or perform
npm WARN reify a fresh install with no lockfile if the problem persists.
npm WARN reify invalid or damaged lockfile detected
@Sun bear And do you get something in the server logs? I would expect to see an error in the logs when you visit the page
Turkish AngoraOP
@Turkish Angora Click to see attachment
Turkish AngoraOP
do you have a vercel.json in your project?
seems like all requests are returning the base html
@joulev seems like all requests are returning the base html
Turkish AngoraOP
yes i have
 {
  "builds": [
    {
      "src": "package.json",
      "use": "@vercel/static-build",
      "config": {
        "distDir": "dist"
      }
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "/index.html"
    }
  ]
}
uhh are you not using nextjs?
Turkish AngoraOP
no
am using vite react js and three js
@joulev uhh are you not using nextjs?
Turkish AngoraOP
doesn't vercel deploy other than next js
@Turkish Angora doesn't vercel deploy other than next js
yes it can though this is a nextjs server, not a vercel server...

anyway it looks like you don't need a vercel.json, though. a typical vite app can simply be pushed to github and deployment to vercel will just work https://vitejs.dev/guide/static-deploy.html#vercel-for-git
that vercel.json currently configures that all requests are routed to index.html. hence your stylesheet and script requests are routed to index.html too
yes
Turkish AngoraOP
what happens internally if vercel json file is removed
vercel.json holds the configuration that you use to tell vercel how to deploy. here you don't need it, but in advanced use cases you might
Turkish AngoraOP
still nothing happened after deleting that json file
have you redeployed?
nvm looks like you did redeploy. then i cant help here, sorry – i don't use vite. hope someone else will be able to help
(though this is a nextjs server, not a vercel server. you probably will have more luck asking in the reactiflux server or a vite server if it exists)