Custom 404 and Error pages not working with Shopify/Next.js

Currently using Koa/Next for my Shopify app, but the usual method of adding custom 404/error pages with Next.js is not working, as detailed here:

https://nextjs.org/docs/advanced-features/custom-error-page

I’ve added the 404.js and _error.js in “/pages”, but they’re never used. I’ve updated my Koa/shopify/next packages, and no change.

It simply displays the next “Not found” for 404’s, as is the default I believe. That and there’s a console error regarding the missing script chunk for the unknown page.

Any ideas?

1 Like