diff --git a/nice.py b/nice.py index 239bc26..0932f5f 100644 --- a/nice.py +++ b/nice.py @@ -715,6 +715,15 @@ def launch_app( logger.debug(f"Work dir: {WORK_DIR}") + # When running as a frozen executable, the native/webview backend + # (which depends on pythonnet) can fail to load inside the bundled + # runtime. Disable native mode automatically for frozen builds so the + # app falls back to launching in the browser and remains usable. + if getattr(sys, "frozen", False): + if native_mode: + logger.debug("Running frozen executable: disabling native mode to avoid pythonnet loader issues") + native_mode = False + if nng: socket_error = False try: