flet icon indicating copy to clipboard operation
flet copied to clipboard

bug: FLET_ASSETS_DIR returns None in Windows build

Open Alex25820 opened this issue 3 months ago • 1 comments

Duplicate Check

  • [x] I have searched the opened issues and there are no duplicates

Describe the bug

When creating a Windows build the environment variable FLET_ASSETS_DIR returns None. When running the app with the flet run command the path resolves correctly.

Code sample

Code
import os

import flet as ft


def main(page: ft.Page):
        print(os.getenv("FLET_ASSETS_DIR"))


ft.app(main)

To reproduce

  1. Create a new Flet project using the flet create command.
  2. Add the following to pyproject.yaml to make sure that app can build: (See: #5630)
[tool.flet.flutter.pubspec.dependency_overrides]
webview_flutter_android = "4.10.1"
  1. In main.py add the following lines: (See Code above for full main.py)
import os

...

print(os.getenv("FLET_ASSETS_DIR"))
  1. Build the app for windows using flet build windows.
  2. Run the build.
  3. Navigate to %localAppData%\Flet\{nameOfProject} and open console.log.
  4. Output in None.

Expected behavior

The default assets path is returned. I believe it should be %appData%\Flet\{nameOfProject}\flet\app\assets.

Screenshots / Videos

No response

Operating System

Windows

Operating system details

Windows 11

Flet version

0.28.3

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

No response

Additional details

Both os.getenv("FLET_APP_STORAGE_DATA") and os.getenv("FLET_APP_STORAGE_TEMP") return the correct path.

I have also tried setting the assets_dir but this has no effect. (ft.app(main, assets_dir = "assets"))

I am unaware if this effects any other platform but Windows.

Alex25820 avatar Oct 09 '25 16:10 Alex25820

Just adding that this also seems to happen with Linux and macOS builds

jnsh avatar Nov 21 '25 04:11 jnsh