title: Getting _flutter is undefined in flutter web, only in production
body: <p>I have an error that has been appearing in my last few deploys and I am unable to trace it.
  It only happens when I deploy to firebase website, debug works without any issues.</p>
  <pre><code>Uncaught SyntaxError: Unexpected token '&lt;' (at flutter.js:1:1)
  (index):50 Uncaught ReferenceError: _flutter is not defined
      at (index):50:7
  </code></pre>
  <p>This shows up in the browser console.</p>
  <p>This is my index.html:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;!--
      If you are serving your web app in a path other than the root, change the
      href value below to reflect the base path you are serving from.
  
      The path provided below has to start and end with a slash &quot;/&quot; in order for
      it to work correctly.
  
      For more details:
      * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
  
      This is a placeholder for base href that will be replaced by the value of
      the `--base-href` argument provided to `flutter build`.
    --&gt;
    &lt;base href=&quot;$FLUTTER_BASE_HREF&quot;&gt;
  
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta content=&quot;IE=Edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
    &lt;meta name=&quot;description&quot; content=&quot;Trading made easy&quot;&gt;
    &lt;meta name=&quot;google-signin-client_id&quot;
      content=&quot;xxx.apps.googleusercontent.com&quot;&gt;
  
    &lt;!-- iOS meta tags &amp; icons --&gt;
    &lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot;&gt;
    &lt;meta name=&quot;apple-mobile-web-app-status-bar-style&quot; content=&quot;black&quot;&gt;
    &lt;meta name=&quot;apple-mobile-web-app-title&quot; content=&quot;tornmarket&quot;&gt;
    &lt;link rel=&quot;apple-touch-icon&quot; href=&quot;icons/Icon-192.png&quot;&gt;
  
    &lt;!-- Favicon --&gt;
    &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;favicon.png&quot; /&gt;
  
    &lt;title&gt;Torn Market&lt;/title&gt;
    &lt;link rel=&quot;manifest&quot; href=&quot;manifest.json&quot;&gt;
    &lt;!-- &lt;script&gt;self.FIREBASE_APPCHECK_DEBUG_TOKEN = true;&lt;/script&gt; --&gt;
    &lt;script&gt;
      // The value below is injected by flutter build, do not touch.
      var serviceWorkerVersion = null;
    &lt;/script&gt;
    &lt;!-- This script adds the flutter initialization JS code --&gt;
    &lt;script src=&quot;flutter.js&quot; defer&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;script&gt;
      window.addEventListener('load', function (ev) {
        // Download main.dart.js
        _flutter.loader.loadEntrypoint({
          serviceWorker: {
            serviceWorkerVersion: serviceWorkerVersion,
          }
        }).then(function (engineInitializer) {
          return engineInitializer.initializeEngine();
        }).then(function (appRunner) {
          return appRunner.runApp();
        });
      });
    &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>