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

BUG: img srcset 404 causes infinite request loop #6332

Open
2 tasks done
tim-prom opened this issue Nov 26, 2024 · 0 comments
Open
2 tasks done

BUG: img srcset 404 causes infinite request loop #6332

tim-prom opened this issue Nov 26, 2024 · 0 comments

Comments

@tim-prom
Copy link

tim-prom commented Nov 26, 2024

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Chrome v131

Reproducible demo link

https://jsfiddle.net/cmq9end2/1/

Describe the bug

How to reproduce the bug?

  1. Add an img to the canvas with an invalid URL in the srcset
  2. Check the network tab in Chrome dev console - the asset request correctly returns a 404, but the browser continues to make this request in an infinite loop.
Screenshot 2024-11-26 at 9 40 17 AM

What is the expected behavior?
img is not requested again after the first 404, and ideally shows same fallback as when there is a broken src

<div id="gjs">
  <img srcset='https://dsfdsfsdfdfsdf.com/brokeimg.png'/>
</div>
const editor = grapesjs.init({
  container: '#gjs',
  fromElement: 1,
  height: '100%',
  storageManager: { type: 0 },
});

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant