Nextjs custom 404 page not showing when accessing invalid url in netlify

Viewed 1083

I've created a 404.js file in /pages folder on my Nextjs project, the 404 page is working perfectly when entering an error or invalid URL in local but when its deployed in netlify they showing the default netlify error page.

enter image description here

version details

"next": "^10.0.4", 
"react": "17.0.2",

Tried netlify's redirect rule, but nothing happened

[[redirects]]
  from = "/*"
  to = "/404.html"
  status = 404
2 Answers
Related