question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running for web from macos got stuck

See original GitHub issue

Description

Browser got stuck when trying to run this script from a macOS. Also flet opens the system default browser and should open Chrome as Flutter does as default.

Only happens when trying to run on web. Run normally when using:

flet.app(target=main)

Code example to reproduce the issue:

import flet
from flet import IconButton, Page, Row, TextField, icons


def main(page: Page):
    page.title = 'Flet counter example'
    page.vertical_alignment = 'center'
    txt_number = TextField(value='0', text_align='right', width=100)

    def minus_click(e):
        txt_number.value = int(txt_number.value) - 1
        page.update()

    def plus_click(e):
        txt_number.value = int(txt_number.value) + 1
        page.update()

    page.add(
        Row(
            [
                IconButton(icons.REMOVE, on_click=minus_click),
                txt_number,
                IconButton(icons.ADD, on_click=plus_click),
            ],
            alignment='center',
        )
    )


flet.app(
    target=main,
    view=flet.WEB_BROWSER,
    web_renderer="html",
    route_url_strategy="path",
)

Describe the results you received: Screenshot 2022-10-03 at 22 15 35

Describe the results you expected: Should open Chrome and not the system default browser. Should appear a page with two icons and a textfield.

Additional information you deem important (e.g. issue happens only occasionally):

Flet version (pip show flet):

0.1.60

Operating system:

macOS
12.3.1

Additional environment details:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.3.1 21E258 darwin-arm, locale
    en-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.71.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sh1l0ncommented, Oct 4, 2022

I am not a Flutter guy, but can you please explain why this is explicitly required?

And btw, what if Chrome is not installed?

First, as dev I would want to run Flutter web on my MacBook as I do normally with Flutter apps. So maybe is a hidden bug that could appear in other base system

Flutter documentation says that u need chrome for debugging. So if no Chrome you should not be able to debug for web.

https://docs.flutter.dev/get-started/web

0reactions
sh1l0ncommented, Oct 4, 2022

What do you have on Network tab then, what resources are being loaded?

Screenshot 2022-10-04 at 23 58 19
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved!] 10 Ways to Fix MacBook Pro Stuck on Loading Screen
2. Reboot into Safe Mode ... The next solution that you should try is to reboot the MacBook Pro in safe mode. The...
Read more >
If an app freezes or quits unexpectedly on Mac - Apple Support
Choose Apple menu > Force Quit, select the app in the dialog that appears, then click Force Quit. If the app quit, reopen...
Read more >
How to fix a frozen MacBook or Mac - Macworld
Click on the Apple logo in the menu bar and choose Force Quit. If an app is not responding it will be highlighted...
Read more >
How to Unfreeze a Mac and What to Do if it Keeps Freezing
We recommend running a full virus scan with MacKeeper to check if ... But if your Mac is frozen completely and you can't...
Read more >
How to fix a Mac stuck on loading screen problem? - MacPaw
So the first solution to this problem is to reset your Mac's SMC. If your MacBook is stuck on the loading screen, this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found