Image src is not working, htmlRewriter

I am trying to add an src attribute to the img element by element.setAttribute("src", "./image.jpg") in index.js, where image.jpg is at the same level as index.js. However, when I render it by wrangler dev, the image is not showing up. I inspect the source page and I can find the attributed being successfully added. Can anyone provide a fix? Thanks!

1 Like

Even I am facing the same issue. Don’t know the fix yet.