Flutter web warns that webOnlyWarmupEngine and webOnlySetPluginHandler are deprecated
The webOnlyWarmupEngine API is deprecated and will be removed in a future release.Short answer
Flutter's web engine marks webOnlyWarmupEngine and webOnlySetPluginHandler in dart:ui as deprecated. Their replacements live in dart:ui_web: bootstrapEngine and setPluginHandler. The warning comes from code that still calls the old names, either your own web entry point or a plugin. Update the call or the plugin.
Fix it fast
1Find out which cause you have
Find out whether the old names are in your code or inside a dependency.
grep -rn "webOnlyWarmupEngine\|webOnlySetPluginHandler" lib web test grep -rln "webOnlyWarmupEngine\|webOnlySetPluginHandler" "$HOME/.pub-cache/hosted/pub.dev" | head2Match what you see, then jump to its fix
What does the error look like?
The webOnlyWarmupEngine API is deprecated and will be removed in a future release.Please use `bootstrapEngine` from `dart:ui_web` instead.The webOnlySetPluginHandler API is deprecated and will be removed in a future release.Please use `setPluginHandler` from `dart:ui_web` instead.
Cause 1 of 2
Your own code calls the old dart:ui functions
1Check
The engine source states that both calls are deprecated and names the replacement from dart:ui_web in each message.
grep -rn "ui.webOnly\|webOnlyWarmupEngine\|webOnlySetPluginHandler" lib web2Fix
Replace webOnlyWarmupEngine with bootstrapEngine from dart:ui_web. Its optional parameters are registerPlugins and runApp, so the plugin registrant and your main run through it. Replace webOnlySetPluginHandler with setPluginHandler from the same library.
import 'dart:ui_web' as ui_web;
Future<void> main() async {
await ui_web.bootstrapEngine(
registerPlugins: registerPlugins, // from web_plugin_registrant.dart
runApp: () => app.main(),
);
}3Verify
Run the app in Chrome and check that the console no longer prints the deprecation text.
flutter run -d chromeConfirmed by flutter.googlesource.com
Cause 2 of 2
A package still calls the deprecated functions
1Check
Find which package owns the file, then see whether a newer release exists.
grep -rln "webOnlyWarmupEngine\|webOnlySetPluginHandler" "$HOME/.pub-cache/hosted/pub.dev"
flutter pub outdated2Fix
Upgrade that package to a release that uses dart:ui_web. If none exists, open an issue on its repository; the warning is harmless until the API is removed, but a removal will then break your web build.
flutter pub upgrade <package-name>3Verify
Run the web build again and read the console for the same text.
flutter build webConfirmed by api.flutter.dev
How do I stop it coming back?
- Run flutter pub outdated before every Flutter upgrade and move web plugins forward first.
- Keep web/index.html and flutter_bootstrap.js on the documented loader instead of hand-written engine calls.
- Do not call engine internals from app code; use the dart:ui_web APIs that the docs list.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
- SessionBirdAn omnichannel engagement suite in Flutter: campaigns, chatbot, tickets, analytics and live calling.
Related fixes
Mobile apps
Flutter web warns that serviceWorkerVersion or the service worker is deprecated
Warning: In index.html:37: Flutter's service worker is deprecated and will be removed in a future Flutter release.
Flutter no longer generates or registers a caching service worker, so the old variable and loader settings in web/index.html are now flagged.
4 causes, each with a fixWeb apps
Firebase Messaging cannot register its default service worker
messaging/failed-service-worker-registration
Firebase Messaging registers a file called firebase-messaging-sw.js from the root of your domain.
3 causes, each with a fixWeb apps
Dart Sass warns that the legacy JS API will be removed
Warning appears on every build after updating sass to 1.79.0 or newer
The warning means a tool in your build still calls Dart Sass through its old render or renderSync functions.
2 causes, each with a fixWeb apps
Sass says a mixin is undefined although the file defines it
Module build failed (from ./node_modules/sass-loader/dist/cjs.js)
Sass only sees a mixin that the current file loads.
4 causes, each with a fixWeb apps
Vuetify build fails on a Sass variable that is not configurable
@use 'vuetify/settings' with (
Sass lets you change a module's variables through @use ..
2 causes, each with a fixWeb apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fix