Image widget in PWA Offline not showing the image

0
I'm looking for help with an issue in my Mendix 11.7 PWA project. I'm trying to implement fully offline mode, but the Image widget doesn't display images after using the TakePicture JS action. I've checked that the images exist and can be accessed through the hasContents property.As a workaround, I modified the JS action to return a base64 string, which I then used to display the image in an HTML element.However, I'm wondering if this is a limitation specific to the Image widget for now or if there's something related to the new IndexedDB architecture.
asked
2 answers
1

hi,

Why Your Image Isn’t Showing

In Mendix 11 PWA Offline mode, the image is correctly stored in IndexedDB and hasContents = true confirms this — but the standard Image widget cannot always render it in fully offline mode. That’s a current platform limitation, not a problem with your logic.

What’s Happening

  • The PWA offline architecture stores files in IndexedDB.
  • The Image widget normally fetches images using a server endpoint (/file?guid=…).
  • In fully offline PWA mode, that server endpoint isn’t reachable, so the widget cannot resolve and display the image.
  • That’s why despite hasContents = true, nothing shows.

Correct & Working Workaround

The recommended and 100% working approach right now (used by others successfully) is:

  • ✔ Return the image data as a Base64 string in your JavaScript action
  • ✔ Display the image in an HTML element using:

<img src="data:image/jpeg;base64, INSERT_BASE64_HERE" />

This bypasses the built-in file resolver and works offline because the browser renders the Base64 directly.

Key Point

This behavior is currently a limitation of offline PWAs in Mendix 11, not a bug in your implementation. The base64/HTML method is the recommended workaround until Mendix updates the Image widget to support offline IndexedDB files directly.

answered
0

Hello,


This is a known limitation of fully offline PWAs in Mendix 11.7.

The image is correctly stored in IndexedDB, and hasContents = true confirms the file exists. However, the Image widget cannot always resolve and display FileDocument images directly from IndexedDB in fully offline mode.

Your base64 workaround works because it bypasses Mendix’s file resolution and allows the browser to render the image directly.

So this is not an implementation issue, but a current platform limitation. Using base64 or an HTML element is the recommended workaround for offline image display.


Thanks

answered