question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Error Page Not Working

See original GitHub issue

Bug report

Describe the bug

I’ve been following the instructions here for some time: https://nextjs.org/docs#custom-error-handling

But it doesn’t seem that whether I deploy a site using @now/static-build or using @now/next, whenever I get a 404 on my site, the site gets redirected to the default now 404 page, not my custom page.

To Reproduce

I have a small example of a website that utilizes next and bulma and node-sass and @zeit/next-sass. Here’s the source code:

https://github.com/jvarness/next-with-bulma

For convenience, I have deployed this public project to zeit using both the next builder and the static-build builder.

https://next-with-bulma-72ahovqkn.now.sh/ <- next lambdas https://next-with-bulma-1lj0u8d2k.now.sh/ <- static

Might this have something to do with how next-sass alters the webpack config? I don’t think so but I’m unsure.

Expected behavior

When I go to the fake page on both, I should get the custom 404 page, but I just get the zeit one:

https://next-with-bulma-72ahovqkn.now.sh/fake https://next-with-bulma-1lj0u8d2k.now.sh/fake

Screenshots

I don’t have any screenshots for this.

System information

  • OS: Windows
  • Browser (if applies) Chrome
  • Version of Next.js: 8.1.0

Additional context

You guys are awesome and your products are fantastic!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
jvarnesscommented, Jun 7, 2019

@Timer still doesn’t appear to be working for static. New URLs:

https://next-with-bulma-j9nerbg2e.now.sh/woop <- Lambdas https://next-with-bulma-7pamzks1f.now.sh/woop <- Static

0reactions
balazsorban44commented, Jan 29, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web.config - Custom error pages not working - Stack Overflow
I try it by changing the url in the browser from .../default.aspx (which is fine) to .../abc.aspx . Is this the correct way...
Read more >
Custom error page not working correctly. - MSDN - Microsoft
The solution is to change the httperrors' mode to 'Custom' and remove the '404' default error page and add your error handler for...
Read more >
Custom error page is not working - Knowledgebase - Todhost
The first step on checking a custom error page that is not working is to check the codes and correcting any errors.
Read more >
How to Create a Great Custom 404 Error Page (with Examples)
Step 1: Design the Page · A clear statement that the page the user requested isn't available · Advice to help your users...
Read more >
IIS 10 Custom 404 Error pages not working - Server Fault
Custom 404 Error pages that have been working on my test machine for years, with Windows 7, no longer work within Windows 10's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found