1

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>
samuelnehool
  • 147
  • 15

2 Answers2

0

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!

  • Can you please give some context to your -value? I struggle with exactly the same issue and I wonder what you mean if you say "...should be the path to YOUR Flutter app..." - where does the path start, where does it end? – JohnnyRainbow Oct 03 '22 at 12:30
  • Well, my site has following url: https://jernberg.org/sandbox/flutter/ So, compare it to the value: "/sandbox/flutter/". Hope it helps! – Mr Jernberg Oct 05 '22 at 17:44
-2

I confused /web and /build/web.

samuelnehool
  • 147
  • 15