Closed terrymun closed 1 year ago
Hello, @terrymun 👋 and thanks for opening this issue. This actually looking like an issue that would be more related to the Amplify Hosting side. I'll transfer your issue over to that repo for better assistance.
Thanks a lot for your help @cwomack 👍
Can confirm our project is suffering from the same issue: image routing is not working as expected.
I have suddenly a similar issue in nextjs 13.4.12 without any change to the code base.
I tried redeploying a previous build that was working fine during the last 5 days, But now it doesn't work properly and everything's broken.
Here's the deployed preview:
https://pr-14.d1uhtp6enph3is.amplifyapp.com/
Problem Solved [Updated to 13.4.13]
Facing similar issue in Next 13.4.8. Can I know when will it be fixed?
Still seeing the same issue in next@13.4.16: the Middleware redirects are still being ignored.
We are using next-intl which sets up a middleware. When deploying the app to Vercel it works, when deploying to Amplify hosting - 404 pages. I experienced that with Nextjs version 13.4.13 and now with 13.4.16. This block us from updating the Nextjs containing important fixes.
We are using next-intl which sets up a middleware. When deploying the app to Vercel it works, when deploying to Amplify hosting - 404 pages. I experienced that with Nextjs version 13.4.13 and now with 13.4.16. This block us from updating the Nextjs containing important fixes.
The last known version of Nextjs that works with Amplify is 13.4.12, that’s our experience as well.
It looks like this change in Next.js is the problem: https://github.com/vercel/next.js/pull/52492/files
We're working in a fix to be able to support newer versions.
It looks like this change in Next.js is the problem: https://github.com/vercel/next.js/pull/52492/files
We're working in a fix to be able to support newer versions.
@calavera Thanks for the insights! Out of curiosity, when you say “we”, are you referring to the team behind Amplify hosting or Vercel?
@calavera Thanks for the insights! Out of curiosity, when you say “we”, are you referring to the team behind Amplify hosting or Vercel?
Amplify Hosting
Cross-posting the issue on Next.js side: https://github.com/vercel/next.js/issues/53872
Hey All, is there any update on this? Is this something that gonna be fixed soon or we might have to wait?
This is still an issue on next@13.4.19
i've downgraded my next v to v.13.4.11 and it works, This is the workaround for now until our friends in AWS fix this.
and It happens to be like if you are using headlessui
, you must also downgrade that because of this issue
https://github.com/tailwindlabs/headlessui/issues/2606#issuecomment-1647907596
The issue still occurs with next@13.4.19 on AWS Amplify
@nii3601 nobody given anyupdate yet, so we expect this to be happening yet.
Thanks @ethyaan , apologies if that came off the wrong way. I was commenting so that I could follow along with this thread. Wish your team all the best in solving this issue.
We're working in a fix to be able to support newer versions.
What is the latest Next version that Amplify supports today? 13.3.4? 13.4.11? Is there a place where we can keep track of this always-updated information, in addition to jumping between issues?
@andre-mr The last Next.js version that works with AWS Amplify is 13.4.12
13.4.11 for @ethyaan and 13.4.12 for @terrymun
i have some cloudfront cache issues here using 13.3.4 and 13.2.4. i'll try to update to see if it makes any difference. but i'll try not to update to something higher than these you mentionend for now, thanks.
@Jay2113 Is there an ETA on a fix for this issue as yet please or is it still under investigation?
My middleware is working in 13.4.12 but nothing newer.
Got stuck even in v13.4.12.
@rafin-whitehat that's weird, maybe it's due to something else. Like others mine is working with 13.4.12.
I forgot to add unoptimized:true
and I think that worked.
It's Funny, people here discussing anything except the fact that AWS Amplify not keeping up with latest releases. 1 Month passed and they know the issue, but still nothing happened. I'm gonna escalate this from our partnership panel with AWS. we paying so much money for using outdated versions. it's ridiculous. if you can't keep up, we move all our services on other providers.
Hi folks 👋 , sorry for the inconvenience. We are currently deploying the fix through the system, the ECD for this deployment is Wed 09/13. thanks for your patience again.
@victorccccc Thanks for giving us an update and an ETA for the fix. Is it possible to shed light on what actually broke behind the scenes? Asking from a place of curiosity.
Deployment complete in all regions, please build your app again to receive the update.
Is it possible to shed light on what actually broke behind the scenes? Asking from a place of curiosity.
It's caused by a breaking change: https://github.com/vercel/next.js/pull/52492 brought by the next.js on a patch release (13.4.12->13.4.13). This change separates routing code from render servers so that next-server only handles the “render” work and the “router" work is handled by router server now. We are missing "router" part in next server after this release so things broke.
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
This issue has been automatically locked.
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Not applicable
Amplify Categories
hosting
Environment information
Describe the bug
We have a typical Next.js site middleware config that ensures requests to paths starting with
_next
are ignored, so that we can use the image optimizer provided. It also performs a redirect to a localized URL if no locale is detected.The issue:
/_next/image?url=...
is not being routed through the image optimizer unlike the local environment/...
is not redirected to a localized URL, e.g./en-us/...
All these suggest that the middleware is not being used at all, as the redirection behavior is expected based on the middleware config.
🐛 This bug is only reproducible in
next@13.4.13
and above (including the latest canary13.4.14-canary.1
. When downgrading the dependency to13.4.12
the issue goes away and all redirects work as expected.Expected behavior
The middleware routing should work as expected, e.g.:
/_next/image?url=...
/...
→/en-us/...
Reproduction steps
output: 'standalone'
<Image src={staticImageImport} alt="" />
so that you will force Next.js to use the image optimizer to load the imageCode Snippet
A boiled down version of our middleware config:
Log output
No response
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response