I just upgraded to Flutter 3.22.0 and am getting the following error when running my Flutter web app on chrome:
Warning: In index.html:84: Local variable for "serviceWorkerVersion" is deprecated.
Use "{{flutter_service_worker_version}}" template token instead.
Any ideas on how to fix this?
2
Answers
I fixed this by comparing my old index.html to a newly created empty Flutter 3.22 project.
In my case the old index.html body contained something like the following:
The empty Flutter 3.22 project only contained a single line.
I just replaced the long script with the short one from the latest Flutter version (as outlined by the Flutter team here) and things seem to be working now.
Martin Reindl’s answer works pretty well!
Do not try to manually edit the
index.html
adding the missing variable or changing function names cause the flutter dev env will not start.