flutter / flutter/flutter

FlutterLoader could not find a build compatible with configuration and environment (wasm + canvaskit)

Open
#183,265 2 comments 3 reactions 1 assignee Claimed by @mdebbar View on GitHub
:hourglass_flowing_sand: d: docs/
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

1. Follow instructions at https://docs.flutter.dev/platform-integration/web/renderers#choosing-a-renderer-at-runtime to force "canvaskit" renderer.

```js
_flutter.loader.load({
config: {
renderer: "canvaskit",
},
});
```

2. Run `flutter run -d chrome --wasm`

Expected: flutter app runs in Chrome

Actual: chrome opens with an error in console

```
flutter_bootstrap.js Uncaught (in promise) FlutterLoader could not find a build compatible with configuration and environment.
```

The app runs correctly without `renderer: "canvaskit"` in the config and uses "skwasm" renderer.

The app runs correctly with `renderer: "skwasm"` in the config.

Building the app with `flutter build web --wasm` and running in Chrome with `renderer: "canvaskit"` results in js build being used.

Expected result is to be able to run a `wasm` build with the `canvaskit` renderer as it appears it should be possible according to the documentation at https://docs.flutter.dev/platform-integration/web/renderers

```shell
❯ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.41.3, on Fedora Linux 43 (Workstation Edition)
6.18.13-200.fc43.x86_64, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Connected device (2 available)
[✓] Network resources
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.