-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Next.js - Static Images 400 error "The requested resource isn't a valid image." #3819
Comments
Hi @claptimes5 , thanks for letting us know. We are looking into it. It appears to be related to a trailing slash in the |
@claptimes5 We mitigated the problem on your app. Can you help us confirm if you happen to have this setting disabled in your module.exports = {
trailingSlash: false,
} |
It appears the problem is fixed! Our config has |
ok, yeah that's what I meant, |
Thanks for your help! |
|
Hi @claptimes5, may I ask why are you using |
It's been a year and a half since we added that change, so I'm not 100% sure. I think it's related to how we were previously deploying this code in S3 and Cloudfront (SSG). We needed the |
ah, that makes sense. Ok, yeah you shouldn't need it on Amplify Hosting. But thanks for the info. It helps! |
Hello, our images on Next.js + Amplify have also started generating 400s due to this issue. We have trailing slash = true as well. For SEO purposes, it can cause problems with duplicate content and crawl efficiency if your pages are accessible with and without a trailing slash, so although somewhat a matter of preference, we force the slash. Also, the interpretation of relative urls can get a bit messy if you are mixing trailing slash styles. Further discussion here: https://stackoverflow.com/a/16445016/417697 . I should add that just leaving the default of "false" would also accomplish the same thing (consistency along with a forced redirect), but somebody made the design choice to set it to true back when we started building the app a couple years ago, so for a lot of reasons we would prefer not change it back. |
@jonathantp thanks for bringing this up. No problem, you don't need to change anything. We are actively working on addressing this. Can I have your AppId please? |
App Id: d32860zbav175e Note we moved the main branch and associated dns entry to point to a hosted docker container to get the images working again earlier today |
Sorry to hear. We have addressed this issue in the us-east-2 region. Let us know if you still face it. |
This issue should now be resolved in all regions. Please reopen the issue if you continue to face problems. Thank you! |
|
This issue has been automatically locked. |
Before opening, please confirm:
App Id
drk0c55ymjt56
AWS Region
eu-west-3
Amplify Hosting feature
Deployments, Frontend builds, SSR
Frontend framework
Next.js
Next.js version
13.4.2
Next.js router
Pages Router
Describe the bug
Similar to this issue #3795, I didn't make any modifications to my app from Friday until today. Today, the all static images return a 400 error
The requested resource isn't a valid image.
I tried redeploying staging branch with the exact commit on my main branch, but still have the image issue.
I have not redeployed production branch, but don't want to in case this issue expands there.
Looking at the compute logs, I can see this error:
The requested resource isn't a valid image for /_next/static/media/My-Logo-300.cfac4486.png received text/html; charset=utf-8
Expected behavior
Images are rendered correctly
Reproduction steps
Build Settings
No response
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: