Using next.js app deployed on firebase.
I have deployed the app already and using some time.
- I created a dynamic route page
- Deployed again app
- I could access the dynamic page via a router, but once I refresh the page I got a 404 page not found
Solutions that I tried and didn't work:
- Rewrites with dynamicLink true
- Rewrites with destination to the dynamic route and regex / source
"rewrites": [
{
"source": "/job/**",
"destination": "/job/[jobId]/index.html"
}
- cleanUrls true
- trailingSlash: true plus rewrite config with destination to the dynamic page
- Any many more
I found a ton of solutions for this problem but no one didn't work for me.
Any idea?
firebase.json file:
{
"hosting": {
"public": "out",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"cleanUrls": true,
"rewrites": [
{
"source": "**",
"destination": "out/index.html"
}
]
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run build"]
}
]
}