Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 page is buggy #587

Closed
atinux opened this issue Jul 5, 2022 — with Volta.net · 7 comments · Fixed by nuxt/content#1394 or #611
Closed

404 page is buggy #587

atinux opened this issue Jul 5, 2022 — with Volta.net · 7 comments · Fixed by nuxt/content#1394 or #611
Assignees
Labels
bug Something isn't working upstream

Comments

Copy link
Contributor

atinux commented Jul 5, 2022

See on content docs locally

Screenshot 2022-07-05 at 14.09.30.png

@atinux atinux added the bug Something isn't working label Jul 5, 2022 — with Volta.net
@Tahul
Copy link
Contributor

Tahul commented Jul 5, 2022

@atinux ; how did you browsed to /not-found page?

The 404 page should be /404.

This is an issue for sure, that will be fixed by this commit: 8efa04d

Copy link
Contributor Author

atinux commented Jul 5, 2022

On client-side or directing accessing, it is same result

Copy link
Contributor

Tahul commented Jul 26, 2022

I need a second review on this issue!

I think the 404 page works on client-side navigation, but doesn't work with generate and/or direct-hit?

Copy link
Collaborator

smarroufin commented Jul 27, 2022

I digged into content codebase, but honestly I'm not feeling confident about it, don't even understand a third of this code.

First, even on local server (with yarn dev), a non-existing page does not act as it should. It also gives exactly what Atinux screenshoted.

By placing some logs in content code, I can tell that documentDriven.queryPage('/foo') is called and ends with a failure->catch.
Also documentDriven.surroundQuery('/foo') is called and succeeds with a strange result: [ null, null ] even tho I don't know what this is, it looks suspicious.
At the end of the documentDriven.ts, inside the Promise.all, no _page?.redirect is resolved and I guess we should expect one. Only a _surround is trusy in this scope.
(Btw, /server/api/query does the job right and returns a 404 correctly)

@Tahul Leaving it to Flo or someone qualified on Content.

Copy link
Contributor Author

atinux commented Jul 27, 2022

I guess that is an issue that need to be solved in Nuxt Content on the document driven page injected

Harlan did something that we can maybe be inspired from: https://github.com/harlan-zw/harlanzw.com/blob/main/pages/%5B...slug%5D.vue

Would love your input also @farnabaz

@farnabaz
Copy link
Collaborator

farnabaz commented Jul 28, 2022

I believe we should handle 404 redirect on the document-driven page and let middleware/composable return null in case of 404.

Copy link
Contributor Author

atinux commented Jul 29, 2022

Agree, can you open a PR on nuxt/content @farnabaz ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
5 participants