Next.js: Flash 404 error in ssr since v5.0.0

Created on 15 Feb 2018  路  3Comments  路  Source: vercel/next.js


Hi all,

first and foremost, thanks very much for Next.js. It's great.

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

In versions prior to 5, our ssr was functioning as expected for every page.


Current Behavior

Since we upgraded to 5, the page mapped as in
https://github.com/em-casa/frontend/blob/master/server.js#L39
started flashing 404 and displaying if rendered server-side (losing the context).

I ended up making a bare-bones page just to make sure, see
https://github.com/em-casa/frontend/blob/fix-filtered-calls-to-url/pages/listings/index.js
and it still happens.


Steps to Reproduce (for bugs)


  1. In production: https://emcasa.com/imoveis
  2. A branch that if cloned will reproduce the issue without needing the backend:
    https://github.com/em-casa/frontend/tree/fix-filtered-calls-to-url
  3. If testing locally, the page in question is localhost:3000/imoveis

Context

I tried to make sure this isn't an Express issue or anything of the sort. Wonder if anyone has been experiencing something similar. Any help will be greatly appreciated.

Your Environment


| Tech | Version |
|---------|---------|
| next | 5.0.0 |
| node | 9.5.0 |
| OS | macOS highSierra |
| browser | Chrome |

Most helpful comment

I just upgraded to 5.0 today, and came on to search for this very issue. (Except for me, receiving the 404 response routes to a 404.html page. Upon refresh, the correct page is load.)

Tech | Version
-- | --
next | 5.0.0
node | 7.9.0
OS | macOS Sierra
browser | Chrome

All 3 comments

I just upgraded to 5.0 today, and came on to search for this very issue. (Except for me, receiving the 404 response routes to a 404.html page. Upon refresh, the correct page is load.)

Tech | Version
-- | --
next | 5.0.0
node | 7.9.0
OS | macOS Sierra
browser | Chrome

Same, nested routes like /pages/folder1/page1.js stops working and showing 404 after upgrading to 5, currently on the latest version as well (canary-5).

I wonder what's going on with 5 that prevents this from working or if there is a different way to make this work.

Related issue: https://github.com/zeit/next.js/issues/3639

Btw, Looks like the issue is gone in [email protected], but is back on [email protected]

Try upgrading to latest next@canary

Was this page helpful?
0 / 5 - 0 ratings