d2 icon indicating copy to clipboard operation
d2 copied to clipboard

imgbundler: Make more clear when images did not bundle successfully

Open nhooyr opened this issue 3 years ago • 2 comments

See https://github.com/terrastruct/d2/pull/278#issuecomment-1331991147

We ought to replace failed images with a placeholder and include the error in partial renders.

Perhaps we should also prevent watch.js from adding the error to the surrounding HTML and just rely on the returned svg including the error.

nhooyr avatar Nov 30 '22 11:11 nhooyr

I've got some old code lying around in the monorepo at commit 538f5b995ffcaefd245ef8c8509cd55c4049c088 that will be very helpful.

nhooyr avatar Nov 30 '22 12:11 nhooyr

test: {
  icon: https://no.com
}

test2: {
  icon: https://no.com
}

works: {
  icon: https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png
}

test -> test2

produces image without the default placeholder for some reason

alixander avatar Nov 30 '22 22:11 alixander