Skip to content
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

Wrong noscript img src attribute with next/image and loaders #24277

Closed
valse opened this issue Apr 20, 2021 · 1 comment · Fixed by #24011
Closed

Wrong noscript img src attribute with next/image and loaders #24277

valse opened this issue Apr 20, 2021 · 1 comment · Fixed by #24011
Labels
bug Issue was opened via the bug report template.

Comments

@valse
Copy link
Contributor

valse commented Apr 20, 2021

What version of Next.js are you using?

10.1.3

What version of Node.js are you using?

12.21.0

What browser are you using?

Chrome

What operating system are you using?

Windows 10

How are you deploying your application?

Vercel

Describe the Bug

Using any loader with the next\image component, the <img> inside the <noscript> tag has a relative image url instead of absolute:

<noscript>
<img 
...
src="/sample.jpg"
srcSet="https://res.cloudinary.com/../sample.jpg 1x
/></noscript>

Expected Behavior

the url in the src attribute must containt the external domain too

<noscript>
<img 
...
src="https://res.cloudinary.com/../sample.jpg"
srcSet="https://res.cloudinary.com/../sample.jpg 1x
/></noscript>

To Reproduce

https://codesandbox.io/s/practical-borg-emkz4

@valse valse added the bug Issue was opened via the bug report template. label Apr 20, 2021
@kodiakhq kodiakhq bot closed this as completed in #24011 Jun 16, 2021
kodiakhq bot pushed a commit that referenced this issue Jun 16, 2021
In the `noscript` img version the correct `src` and `sizes` attributes are overwritten by not necessary inline declaration; in particular using the loaders the `src` attribute not take the right absolute path. I found this issue using a custom loader and because my site didn't indexing any images on the Google image search.

Fixes #24277
flybayer pushed a commit to blitz-js/next.js that referenced this issue Jun 24, 2021
In the `noscript` img version the correct `src` and `sizes` attributes are overwritten by not necessary inline declaration; in particular using the loaders the `src` attribute not take the right absolute path. I found this issue using a custom loader and because my site didn't indexing any images on the Google image search.

Fixes vercel#24277
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants