You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When entering the editor for an entry, image previews in Markdown and in individual fields are not loaded, showing an empty placeholder SVG instead. The images are shown only after interacting with the editor in some way, e.g. resizing or editing content.
To Reproduce
Clone https://github.com/sproott/astro-decap-images and install dependencies with pnpm
Run pnpm run dev and pnpm run cms to start the web app
I've managed to reproduce the issue on this repo (putting the config in the dev-test directory). Then after adding console.log statements to the getAsset function like so:
let{ asset, isLoading, error }=state.medias[resolvedPath]||{};if(isLoading){console.log("empty")returnemptyAsset;}if(asset){console.log("in memory",{asset})// There is already an AssetProxy in memory for this path. Use it.returnasset;}
It can be observed that the function prints empty for each image, then after a while prints in memory with the correct asset URLs, but the src attributes of the images in the editor stay the same, pointing to the empty SVG image. There seems to be an issue with how the asset state is passed to the Image widget and subsequently updated.
The text was updated successfully, but these errors were encountered:
@sproott thanks for sharing. I see you described the issue well and even dug into the codebase to find the issue. It would be amazing if you could open a PR for a fix.
Describe the bug
When entering the editor for an entry, image previews in Markdown and in individual fields are not loaded, showing an empty placeholder SVG instead. The images are shown only after interacting with the editor in some way, e.g. resizing or editing content.
To Reproduce
https://github.com/sproott/astro-decap-images
and install dependencies withpnpm
pnpm run dev
andpnpm run cms
to start the web appExpected behavior
Image previews should be displayed.
Screenshots
Applicable Versions:
CMS configuration
https://github.com/sproott/astro-decap-images/blob/main/public/admin/config.yml
Additional context
I've managed to reproduce the issue on this repo (putting the config in the
dev-test
directory). Then after addingconsole.log
statements to thegetAsset
function like so:It can be observed that the function prints empty for each image, then after a while prints in memory with the correct asset URLs, but the
src
attributes of the images in the editor stay the same, pointing to the empty SVG image. There seems to be an issue with how the asset state is passed to the Image widget and subsequently updated.The text was updated successfully, but these errors were encountered: