I am using next.js with Static HTML export, and i want to use firebase for hosting.
The problem is that firebase require a page in the root called 404.html for unknown routes.
Is there a way to generate such page using next.js? or maybe change the firebase hosting behavior?
Actually i found a solution, i added to the firebase.json a rewrite to the error page:
"rewrites": [
{
"source": "**",
"destination": "/_error/index.html"
}
]
now, only if the page is not found, firebase will serve the error page as explained here: https://firebase.google.com/docs/hosting/url-redirects-rewrites