Skip to content

Migrate to new flutter bootstrapping #7444

Closed

Description

@kenzieschmoll

Warnings we are now seeing during build:
Screenshot 2024-03-25 at 4 17 49 PM

I took a stab at migrating this but it was not as straightforward as I would have hoped.
Screenshot 2024-03-25 at 4 21 55 PM

CC @eyebrowsoffire maybe the warning message can be tweaked to make the migration path more clear?

Bootstrapping changes: flutter/flutter#144434

Activity

  1. added
    P2important to work on, but not at the top of the work list.
    on Mar 25, 2024
  2. eyebrowsoffire commented on Mar 26, 2024

    @eyebrowsoffire
    Contributor

    BTW, we are planning for the warnings to link to the documentation once it is finalized. Issue tracking the link in the warning: flutter/flutter#145559

    And the issue for documentation for the new bootstrapping in general: flutter/website#10126

    I can assist you getting devtools unblocked if you need. The TL;DR is:

    • Add a file called flutter_bootstrap.js in the web directory in your project, next to index.html
    • Put this in flutter_bootstrap.js:
    {{flutter_js}}
    {{flutter_build_config}}
    _flutter.loader.load({
      serviceWorkerSettings: {
        serviceWorkerVersion: {{flutter_service_worker_version}},
      },
      config: {
        canvasKitBaseUrl: 'canvaskit/',
      }
    });
    
    • Get rid of any flutter.js script tags in the index.html, and just put the following script tag somewhere:
    <script src="flutter_bootstrap.js" async></script>
    

    If you need help with it, just let me know, I'm happy to help iron out any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2important to work on, but not at the top of the work list.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions