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.

Rewrites failing after deployment

See original GitHub issue

What version of Next.js are you using?

10.0.5

What version of Node.js are you using?

15

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

K8S

Describe the Bug

Each time after deploying we have a small blip of rewrites failing. It looks like next.js is redirecting users to the rewritten URL which then causes a 404.

Expected Behavior

For users never to be redirected to the rewritten URL’s.

To Reproduce

I’m not sure how to reproduce this yet, working on that case. But our rewrites look something like:

{
  source: "/plans",
  destination: "/legacy/funnel-fragment/plans"
}

ELB logs of people going to the pages that yield a 404 (/legacy/funnel-fragment/plans) and all other pages that have a rewrite enabled. As you can see it started happening on Jan 21, which is when we upgraded from Next@10.0.3 to Next@10.0.5.

Screen Shot 2021-01-28 at 5 10 17 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
PepijnSenderscommented, Jan 29, 2021

Reverting back to 10.0.3 fixed this issue. Would be great to look at this though because we wanted to use the optimizations to next/image!

1reaction
PepijnSenderscommented, Jan 28, 2021

I feel like this PR might be fixing it: https://github.com/vercel/next.js/pull/21410, but need to test it still.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rewrites not working on Vercel (in production) NextJS
I have been trying to get Rewrites working in NextJS for my API Paths. ... in a production environment (I was deploying on...
Read more >
Deploying with Serverless-next.js not working RFC Custom ...
I am deploying my nextjs app with module serverless-next.js: ... in my server this "rewrite" fails e.g. if I write myserver.com/en/business ...
Read more >
Troubleshooting Common Problems with Web Deploy
This walkthrough shows how to diagnose and fix common problems with Web Deploy, including common errors seen while publishing from Visual ...
Read more >
Rewrites - next.config.js
Rewrites allow you to map an incoming request path to a different destination path. Rewrites act as a URL proxy and mask the...
Read more >
QRadar: Unable to perform deploy changes - IBM
Cause. This issue might be caused by to a previous deploy changes that has failed on one or more managed hosts. Environment.
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