<Image> local src does not work as documented

I’m trying to use an (UI Kit) with local src as documented. Unfortunately, this seem not to work. I tried different approaches, but either the app crashes or I get an error message regarding permission. But permissions should actually only be required for externally hosted images like documented.

I found a workaround by using an “data:image” URI and encoding the image as base64. But it would be quite nicer to directly reference the image file, packaged with the app.

Is the feature broken or the documentation? Or am I missing something?

Welcome to the Atlassian Developer Community, @AndreasZink!

I was able to replicate the issue by using the code snippet you linked. Upon further checking, I noticed that the import statement is incorrect and should be changed to the following,

// Remove the curly braces here
import myCat from './myCat.png'

Do try it out and let us know how it goes.

Thanks for pointing it out and I’ll work on fixing the docs.

Cheers,
Ian

Thank you for your answer. It seems to work for me know.

Altough, I’m still a little confused. When I tried it the first time it did not work. I then updated the forge dependencies, especially ‘@forge/react’, and it worked. I then downgraded ‘@forge/react’ again and tried to reproduce the problem. But I could not reproduce it anymore :man_shrugging:

1 Like