vercel / next.js

The React Framework
https://nextjs.org
MIT License
126.78k stars 26.95k forks source link

Nextjs Component is giving 404 for google crawler if the url is loaded from different domain. #45842

Closed nbsharath closed 1 year ago

nbsharath commented 1 year ago

Verify canary release

Provide environment information

Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Single Language Binaries: Node: 16.18.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 12.3.2 eslint-config-next: 12.3.1 react: 18.2.0 react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

Image optimization (next/image, next/legacy/image)

Link to the code that reproduces this issue

No required

To Reproduce

Use the Image component in page with url from subdomain.

Describe the Bug

If we use Image component with URL from subdomain getting 404 for google crawler. If my domain is xyz.com and i am loading all my images from subdomain cms.xyz.com. For image /_next/image?url=https%3A%2F%2Fcms.eytechai.com%2Fuploads%2Fpoco_m4_pro_5g_cool_blue_f7524c0604.png&w=384&q=75 crawler is trying to hit https://eytechai.com/uploads/poco_m4_pro_5g_cool_blue_f7524c0604.png ( which does not exist ) , since the src starts with /_next... Any solutions for this ?

Expected Behavior

Solution for indicating the correct src for the crawler.

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

github-actions[bot] commented 1 year ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.