Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.
This repository was archived by the owner on May 10, 2021. It is now read-only.

Unknown routes should render 404.html #2

Closed
@gamliela

Description

@gamliela

Hi,

Cool project! I was looking for something similar for quite long, and your solution seems to work pretty well!

The current implementation doesn't support rendering of the 404.html file, if an unknown URL is requested. For example, try this link: https://next-on.netlify.com/some-non-existing-url - it should actually render _next/pages/404.html file.

A quick fix that I've found for this problem is to simply copy the 404.html file to public in a post-build step. Something like cp public/_next/pages/404.html public. The reason is that Netlify are expecting to find this file exactly on this place. But I wonder if that's the right solution, or if there are better ways. Another approach that I've tried was to add /* /_next/pages/404.html 404 at the end of _redirects file, but it didn't work very well with netlify-dev.

Would love to hear your thoughts. Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions