Markdown Does not show image! #2348
Replies: 9 comments
-
Upgrade Flet to the latest and check again. |
Beta Was this translation helpful? Give feedback.
-
Hello Feodor. I am receiveing some system related error during upgrading the flet. I will answer you ASAP whenever I deal with it. Thanks for your time |
Beta Was this translation helpful? Give feedback.
-
Hello Feodor. I upgraded the Flet now it is 0.18.0 however the result is unfortunately the same. @FeodorFitsner |
Beta Was this translation helpful? Give feedback.
-
Can you access the image directly via http://127.0.0.1:8080/icons/icon-192.png ? If not then you're configuration regarding the assets folder isn't working properly. regards |
Beta Was this translation helpful? Give feedback.
-
Dear @cheak1974 I dont know the determination process between the configuration of the assets folder because I tried the image feature of Markdown with a different code and the address of the image file was on my desktop. The other thing is I can not see the image with that link. What should I do to configure it properly? |
Beta Was this translation helpful? Give feedback.
-
Hi @applicatlat, you need a basic folder structure in the bare minimum it could be something like:
In your ´main.py´ there lives your app and the command which starts up the flet app.
The asset argument ist optional if your asset folder is called "assets". You can access the content of the asset folder with the name of the ressource directly attached to the URL of your app. Sub folders can also be accessed. http://127.0.0.1:8080/root_image.jpg regards |
Beta Was this translation helpful? Give feedback.
-
Upgrade to latest Flet please and try again. Also, try configuring |
Beta Was this translation helpful? Give feedback.
-
Dear @FeodorFitsner and @cheak1974 I received this error: "Page error: Unsupported operation: Cannot extract a file path from a c URI. " When I moved the photo assets folder and worked it with view = ft.WEB_BROWSER in browser I was able to view the image but not as standalone. |
Beta Was this translation helpful? Give feedback.
-
I ran into the same problem.
When executing import flet as ft
def main(page: ft.Page):
img = ft.Image(src="/test.png")
md = ft.Markdown("")
page.add(img, md)
page.on_error = lambda e: print("Page error:", e.data)
page.update()
ft.app(target=main, assets_dir="assets")
The following error message appears.
flet version:
Issues that may be related |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Code example to reproduce the issue:
void main() {
runApp(MaterialApp(
home: Scaffold(
body: ft.Markdown(data: markdownData),
),
));
}
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Flet version (
pip show flet
):Operating system:
Additional environment details:
Beta Was this translation helpful? Give feedback.
All reactions