Vercel ReactJs 404 Page Not Found

January 18, 2025·
Chi Yau
Chi Yau
· 1 min read
Image credit: sharechiwai
post Web Dev

今日起左個新 ReactJS Project

諗住練習一下 Front End Skill。
Local run 到無問題,但 deploy 左去 Vercel 上面便出現 404 Page Not Found issue。

404 Not Found

解決方法

在 root folder 上加 vercel.json,之後係入面加返個 rewrite rule 便以了:

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

Hope you find it useful

Chi Yau
Authors
App Dev
I’m Chi, a passionate tech enthusiast exploring the latest innovations in GenAI, LLMs, web development, performance tuning, and cybersecurity. As a tech guy at a startup, I aim to share my experiences, insights, and lessons learned in the fast-paced world of technology. Join me on this journey as we dive into the exciting challenges and triumphs of building and scaling tech solutions!