importantimport/urara

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.
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

Result:
image

Go to the instance on Vercel > View Build Logs > Functions > Realtime Logs
You will get similar erorr like the following image.
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

Result:
image

Go to the following URL, the 2nd time it will show the correct 404 page
https://urara-demo.netlify.app/404

Result:
image

kwaa commented

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.

kwaa commented

Update: what is certain at the moment is that it will report an error even if there is only plain text.

kwaa commented

Update: It works fine after removing the html-minifier import. possible dependency issue

kwaa commented

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.