You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do Next.js rewrites with an external destination (proxying) work with web framework? #5976
add an external destionation to the nextjs config rewrites.
[REQUIRED] Steps to reproduce
Here is what my rewrites look like:
async rewrites() {
return [
{
source: "/mp/track/:slug*",
destination: "https://api-js.mixpanel.com/track/:slug*",
},
{
source: "/mp/engage/:slug*",
destination: "https://api-js.mixpanel.com/engage/:slug*",
},
{
source: "/mp/:slug*",
destination: "https://api-js.mixpanel.com/:slug*",
},
];
},
[REQUIRED] Expected behavior
Locally this works and the nextjs server just proxies the request.
[REQUIRED] Actual behavior
Once it deploys with firebase via the SSR Cloud function, the logs for the ssrproject function show that it first issues a redirect (from https://.com/mp/track/?verbose=1 to https:///mp/track?_=1686698765113&ip=1&verbose=1) and when the app tries to hit that second url it sends a 408.
I've looked through a ton of the docs. It doesn't say anywhere that external rewrites like this aren't supported. That would be my first question, is this possible?
Secondly the cloud function just logs the response (308 at first, and then a 408), so if you have suggestions for extra debugging help, I'm all ears.
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
Activity
google-oss-bot commentedon Jun 13, 2023
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
alexastrum commentedon Jun 24, 2023
Fixed in https://www.npmjs.com/package/firebase-frameworks/v/0.10.4