Giter VIP home page Giter VIP logo

Comments (7)

navaronbracke avatar navaronbracke commented on June 16, 2024

I can reproduce this bug.

  1. flutter create web_sample
  2. cd web_sample
  3. flutter build web --no-web-resources-cdn
  4. cd build/web
  5. dart pub global run dhttpd (I installed dhttpd globally with Pub)
  6. open a new chrome window and open the network tab
  7. go to localhost, under the port of dhttpd
  8. All assets, except a variant of the Roboto font (a TTF file) come from localhost. The Roboto font comes from fonts.gstatic.com (ignore the pageScript.js in my screenshot, that is a local chrome extension that I have)
Screenshot 2024-05-21 at 11 10 59
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.4.1 23E224 darwin-x64, locale
    en-BE)
    • Flutter version 3.22.0 on channel stable at
      /Users/navaronbracke/Documents/flutter
    • Upstream repository [email protected]:navaronbracke/flutter.git
    • FLUTTER_GIT_URL = [email protected]:navaronbracke/flutter.git
    • Framework revision 5dcb86f68f (12 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/navaronbracke/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.4.1 23E224 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.209

[✓] Network resources
    • All expected network resources are available.

• No issues found!

from flutter.

huycozy avatar huycozy commented on June 16, 2024

I checked this on my end and saw the same result as @navaronbracke shared above.

KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf font comes from https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf. But I see script files come from local host (canvaskit.js for eg).

@cfsbhawkins As I see above, canvaskit.js file is still fetched from CDN. Do you have any specific configuration on web module? Could you confirm this on a new Flutter project?

from flutter.

cfsbhawkins avatar cfsbhawkins commented on June 16, 2024

I checked this on my end and saw the same result as @navaronbracke shared above.

KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf font comes from https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf. But I see script files come from local host (canvaskit.js for eg).

@cfsbhawkins As I see above, canvaskit.js file is still fetched from CDN. Do you have any specific configuration on web module? Could you confirm this on a new Flutter project?

Yes can confirm on a new project pulls from gstatic cdn after upgrade to 3.22

Steps to reproduce

  1. New Project created under 3.19.6
  2. Build with flutter build web --no-web-resources-cdn --web-renderer canvaskit --release
  3. Launch site with dhttpd, canvaskit comes from local copies, that roboto font is only one that loads from CDN.
  4. run flutter upgrade
  5. delete web folder in project to create new index.html from 3.22 template.
  6. run flutter create --platforms=web .
  7. Build with flutter build web --no-web-resources-cdn --web-renderer canvaskit --release
  8. Launch site with dhttpd, canvaskit and js files load from google CDN and not local image.

3.19.6
Screenshot 2024-05-22 at 4 09 02 PM

3.22
Screenshot 2024-05-22 at 4 38 22 PM

from flutter.

cfsbhawkins avatar cfsbhawkins commented on June 16, 2024

Repo: https://github.com/cfsbhawkins/web_test

from flutter.

huycozy avatar huycozy commented on June 16, 2024

Thanks for your update, @cfsbhawkins. I see the issue. On a newly created project or re-created web module, canvaskit.js and canvaskit.wasm files are used from gstatic.com instead of localhost.

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.22.1 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (11 hours ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.76

[✓] Network resources
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.22.0-44.0.pre.10, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.22.0-44.0.pre.10 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fe0932f2c0 (76 minutes ago), 2024-05-22 22:19:25 -0400
    • Engine revision b8b82454e3
    • Dart version 3.5.0 (build 3.5.0-178.0.dev)
    • DevTools version 2.36.0-dev.10
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 125.0.6422.76

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

from flutter.

kevmoo avatar kevmoo commented on June 16, 2024

@eyebrowsoffire @yjbanov ?

from flutter.

sashkent3 avatar sashkent3 commented on June 16, 2024

Putting the following in the web/flutter_bootstrap.js fixes the issue:

{{flutter_js}}
{{flutter_build_config}}

_flutter.loader.load({
    config: {
        canvasKitBaseUrl: "canvaskit/"
    },
    serviceWorkerSettings: {
        serviceWorkerVersion: {{flutter_service_worker_version}}
    }
});

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.