Skip to content

Running for web from macos got stuck #435

@sh1l0n

Description

@sh1l0n

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions