404 pages not working as intented when deployed
Closed this issue · 4 comments
Expected Behavior
In local dev, 404 pages are working as intented.
For non-existent path, it will generate dynamic 404 pages like the following image.
Current Behavior
However, when depolyed on both vercel and netlify, it will show function crash message.
On Vercel, it will always show function crash message.
On Netlify, for the same path it will show the crash message the first time. Next time, it will show the correct 404 page.
To Reproduce on Vercel
Go to the following URL, it will show function crash message
https://kwaa.dev/404
Go to the instance on Vercel > View Build Logs
> Functions
> Realtime Logs
You will get similar erorr like the following image.
To Reporduce on Netlify
Go to the following URL, the 1st time it will show function crash message
https://urara-demo.netlify.app/404
Go to the following URL, the 2nd time it will show the correct 404 page
https://urara-demo.netlify.app/404
This seems to have started after one of the updates and I'm not sure how to fix it at the moment;
I'll try to fix it later.
Update: what is certain at the moment is that it will report an error even if there is only plain text.
Update: It works fine after removing the html-minifier
import. possible dependency issue
I think this issue is the same as sveltejs/kit#4247.
as a workaround, I'm considering to stop using html-minifier
and wait for a better solution.