Is `Flutter build web` supposed to output a file called flutter.js? Because it does not by me :(

Viewed 266

In Flutter web apps, there is a reference to a script called flutter.js but it is not outputed by the build. Is it normal? It actually gives a 404 error in one of my apps :(.

enter image description here

index.html

<script>
    // The value below is injected by flutter build, do not touch.
    var serviceWorkerVersion = null;
  </script>
  <!-- This script adds the flutter initialization JS code -->
  <script src="flutter.js" defer></script>
2 Answers

After some frustration and some investigation...

In: enter image description here

Change (IF app is not in root of website): enter image description here

So, href value should be the path to YOUR Flutter app with "/" as start and end in value.

Enjoy!

Related