From 7cee3bcaa3a3b8c69e8925c268556e2a8608d5fa Mon Sep 17 00:00:00 2001 From: Kevin Lamenzo Date: Fri, 4 Sep 2026 02:29:25 +0000 Subject: [PATCH 1/3] docs: clarify FlutterLoader.loadEntrypoint deprecation Fixes #12184 --- .../web/initialization.md | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/sites/docs/src/content/platform-integration/web/initialization.md b/sites/docs/src/content/platform-integration/web/initialization.md index c5791a307b..560df07be6 100644 --- a/sites/docs/src/content/platform-integration/web/initialization.md +++ b/sites/docs/src/content/platform-integration/web/initialization.md @@ -260,7 +260,9 @@ _flutter.loader.load({ }); ``` -## Common warning +## Common warnings {:#common-warnings} + +### Service worker version deprecation If you experience a warning similar to the following: @@ -269,8 +271,40 @@ Warning: In index.html:37: Local variable for "serviceWorkerVersion" is deprecat Use "{{flutter_service_worker_version}}" template token instead. ``` -You can fix this by deleting the following line from the `web/index.html` file: +Delete the following line from the `web/index.html` file: ```html title="web/index.html" var serviceWorkerVersion = null; ``` + +### FlutterLoader.loadEntrypoint deprecation + +If you experience a warning similar to the following: + +```text +Warning: In index.html:40: "FlutterLoader.loadEntrypoint" is deprecated. +Use "FlutterLoader.load" instead. +``` + +This warning occurs when an older `web/index.html` file uses +`_flutter.loader.loadEntrypoint()` instead of `_flutter.loader.load()`. +The CLI message references the `FlutterLoader` interface, +which JavaScript code accesses through `_flutter.loader`. + +To resolve this warning, update your bootstrap code in `web/index.html` +(or a custom `web/flutter_bootstrap.js` file) +to call `_flutter.loader.load()` instead: + +```js +_flutter.loader.load({ + onEntrypointLoaded: async function(engineInitializer) { + const appRunner = await engineInitializer.initializeEngine(); + await appRunner.runApp(); + } +}); +``` + +To review an example that updates DOM elements during startup, +consult the [progress indicator example][]. + +[progress indicator example]: #example-display-a-progress-indicator From 00d76aee315aa6f67c0a44f789070b7af457955d Mon Sep 17 00:00:00 2001 From: Kevin Lamenzo Date: Fri, 4 Sep 2026 03:00:02 +0000 Subject: [PATCH 2/3] docs: suggest flutter_bootstrap.js for default initialization --- .../platform-integration/web/initialization.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sites/docs/src/content/platform-integration/web/initialization.md b/sites/docs/src/content/platform-integration/web/initialization.md index 560df07be6..6c8dab9b71 100644 --- a/sites/docs/src/content/platform-integration/web/initialization.md +++ b/sites/docs/src/content/platform-integration/web/initialization.md @@ -291,7 +291,16 @@ This warning occurs when an older `web/index.html` file uses The CLI message references the `FlutterLoader` interface, which JavaScript code accesses through `_flutter.loader`. -To resolve this warning, update your bootstrap code in `web/index.html` +If your app uses the default initialization and doesn't require +custom bootstrapping, replace the legacy script block in `web/index.html` +with the standard script tag: + +```html title="web/index.html" + +``` + +If you customized your initialization logic, +update your bootstrap code in `web/index.html` (or a custom `web/flutter_bootstrap.js` file) to call `_flutter.loader.load()` instead: From 9be13b193b027608d44ee7e3eb0c040cea4d0aca Mon Sep 17 00:00:00 2001 From: Kevin Lamenzo Date: Tue, 8 Sep 2026 15:33:53 -0700 Subject: [PATCH 3/3] Apply suggestion from @conooi Co-authored-by: Connie Ooi --- .../src/content/platform-integration/web/initialization.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sites/docs/src/content/platform-integration/web/initialization.md b/sites/docs/src/content/platform-integration/web/initialization.md index 6c8dab9b71..4ed848c243 100644 --- a/sites/docs/src/content/platform-integration/web/initialization.md +++ b/sites/docs/src/content/platform-integration/web/initialization.md @@ -262,6 +262,9 @@ _flutter.loader.load({ ## Common warnings {:#common-warnings} +This section describes common web build and initialization warnings +and how to resolve them. + ### Service worker version deprecation If you experience a warning similar to the following: