Home > Enterprise >  All flutter web apps are broken
All flutter web apps are broken

Time:10-29

Several projects we've written in Flutter are broken this morning due to failing to download https://unpkg.com/[email protected]/bin/canvaskit.js. Production sites aren't getting paste their splash screens.

CodePudding user response:

We got our sites going again by deploying them again passing argument to tell it to get the cansvaskit locally: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=OURBASEURL/canvaskit/

CodePudding user response:

It also appears as though the original issue is resolved at unpkg.com.

CodePudding user response:

A little earlier unpkg was down. It looks like it is back up now, but with a CORS policy that is not allowing it to be downloaded from other sites (other sites running Flutter).

I was able to resolve by switching to the HTML renderer in web/index.html:

  <script type="text/javascript">
        window.flutterWebRenderer = "html";
    //window.flutterWebRenderer = "canvaskit";
  </script>

You can also specify the canvaskit url: pass --dart-define=FLUTTER_WEB_CANVASKIT_URL=... and host your own copy of CanvasKit at the URL specified in the --dart-define.

To use the jsdelivr CDN, use the command:

flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=https://cdn.jsdelivr.net/npm/[email protected]/bin/canvaskit.wasm
  • Related