0

I have hosted a Flutter Web app in azure. When I browse it page is not loading. I did inspect element and found 404 errors for two files where it's actually presented in the repository. enter image description hereAbove is the error image

Adding my index file here:

<!DOCTYPE html>
<html>
<head>
 
  <base href=''/>

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  <meta name="description" content="A new Flutter application.">

  <!-- iOS meta tags & icons -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="spaid">
  <link rel="apple-touch-icon" href="icons/Icon-192.png">

  <!-- Favicon -->
  <link rel="icon" type="image/png" href="favicon.png"/>

  <title>spaid</title>
  <link rel="manifest" href="manifest.json">
</head>
<body>
  <!-- This script installs service_worker.js to provide PWA functionality to
       application. For more information, see:
       https://developers.google.com/web/fundamentals/primers/service-workers -->
  <script>
    if ('serviceWorker' in navigator) {
      window.addEventListener('flutter-first-frame', function () {
        navigator.serviceWorker.register('flutter_service_worker.js?v=142317243');
      });
    }
  </script>
  <!--<script src="main.dart.js?version=1" type="application/javascript"></script>-->
  <script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

Did I anything missed here in base href ?

Siva
  • 1,849
  • 2
  • 13
  • 28

3 Answers3

1

Make sure you have defined in your web site the following MIME Types: .json = application/json

So the FontManifest.json and assets/AssetManifest.json can be accessed.

HumbertoS
  • 11
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 08 '22 at 00:22
0

Your base href should be:

  <base href='/'>

and not

  <base href=''/>
Victor Eronmosele
  • 7,040
  • 2
  • 10
  • 33
0

Finally resolved it by adding web.config file manually by seeing here https://stackoverflow.com/a/47140319/8123784

Siva
  • 1,849
  • 2
  • 13
  • 28