Skip to content

Different behavior with and without --wasm #517

@Marc-Andrieu

Description

@Marc-Andrieu

Hello,

Some context first.
I'm trying to enable compilation to WebAssembly for the web version of a Flutter app so that it loads faster.
So, as stated it Migrate to package:web, I essentially replaced dart:html with package:web, which is used only once in the app: to open a small login window, and the Dart code listens to events and closes the small window as soon as our back-end responded successfully.
The app compiles, it loads faster.

The strange thing:

  • When using flutter run ... without a --wasm flag, the behavior is the same as before (i.e.: it works)
  • When using flutter run ... with a --wasm flag, the window opened with window.open(...) has a weird closing behavior:
    • the .closed boolean becomes true half a second after opening the small window
    • the .close() method doesn't do anything at all (and it is being called for sure)

It may be related to the renderer as I run the app locally in a Chrome; thus:

  • before using package:web, only canvaskit was used (wasm compilation obviously failed),
  • according to Web renderers, without --wasm the default mode can only use canvaskit,
  • and with --wasm (the only one of the 3 cases where the window doesn't close), it uses skwasm since Chrome supports it.

Feel free to redirect this issue to somewhere else (perhaps that's a dart:js_interop issue, or a skwasm issue), Migrate to package:web recommended filing an issue here.

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