flutter

Flutter Local variable for "serviceWorkerVersion" is deprecated


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?


Solution

    1. Delete content under /web directory
    2. Run flutter create . --platforms=web to create a new index.html file, together with all the other files necessary

    source: Upgrading an older project