esvin261
esvin261

Reputation: 1

White screen when deploying next.js app on vercel

I'm encountering a white screen issue when deploying my Next.js application on Vercel. I've attempted the following troubleshooting steps, but the error persists:

Here are additional details to facilitate diagnosis:

package.json file:

{
  "name": "nextjs",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@chakra-ui/icons": "^2.1.1",
    "@chakra-ui/react": "^2.8.2",
    "@emotion/react": "^11.11.3",
    "@emotion/styled": "^11.11.0",
    "framer-motion": "^10.18.0",
    "next": "14.0.4",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-icons": "^5.0.1"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.0.1",
    "eslint": "^8",
    "eslint-config-next": "14.0.4",
    "postcss": "^8",
    "tailwindcss": "^3.3.0",
    "typescript": "^5"
  }
}

Github Repo: https://github.com/esvin2661/esvin-portfolio

Thanks in advance!

Updated npm. Added a homepage linked to the Vercel web domain: https://esvin-portfolio.vercel.app/

Upvotes: 0

Views: 256

Answers (1)

Miracle Agholor
Miracle Agholor

Reputation: 1

Apart from making sure your build is accurate without issue, The final solution I have discovered for those deploying to vercel is to create a separately new file; you need to create a new file under the root director, or src (source folder) and name it as vercel.json[src folder][1].

After that you can upload this code into it, what the code actually does is that it tells vercel to re-route all the pages folder to the home(what ever you may call it) folder having the "/" route symbol and render the page there starting with slash.

...

{
"rewrites": [
    {"source": "/(.*)", "destination":"/"}
]
}

...

Upvotes: 0

Related Questions