Issue #6332Opened November 26, 2024by tim-prom0 reactions

BUG: img srcset 404 causes infinite request loop

Question

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.
<img width="646" alt="Screenshot 2024-11-26 at 9 40 17 AM" src="https://github.com/user-attachments/assets/e737d681-a0e0-4155-80ee-e80d104fa869">

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

Answers (0)

No answers yet.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.