In the absence of a network, some resources cannot be found in the browser, and desktop applications are good
NocoleNe opened this issue · comments
Description
ft.app ( target=main , view=ft.AppView.WEB_BROWSER )
The computer is not connected to the Internet. Run the above program in the local development environment, and only display a load icon in the browser,
The browser has the following resources that cannot be found:
https://www.gstatic.com/flutter-canvaskit/e76c956498841e1ab458577d3892003e553e4f3c/chromium/canvaskit.js net::ERR_NAME_NOT_RESOLVED
main.dart.js:10136
GET https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf net::ERR_NAME_NOT_RESOLVED
main.dart.js:10136 Failed to load font Roboto at https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf
main.dart.js:10136 Flutter Web engine failed to complete HTTP request to fetch "https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf": TypeError: Failed to fetch
GET https://www.gstatic.com/flutter-canvaskit/e76c956498841e1ab458577d3892003e553e4f3c/canvaskit.js net::ERR_NAME_NOT_RESOLVED
main.dart.js:10136 Rejecting promise with error: Exception: Failed to download any of the following CanvasKit URLs: (https://www.gstatic.com/flutter-canvaskit/e76c956498841e1ab458577d3892003e553e4f3c/chromium/canvaskit.js, https://www.gstatic.com/flutter-canvaskit/e76c956498841e1ab458577d3892003e553e4f3c/canvaskit.js)
The computer can work normally when connected to the Internet,
Code example to reproduce the issue:
ft.app ( target=main , view=ft.AppView.WEB_BROWSER )
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Flet version (pip show flet
):
Name: flet
Version: 0.22.0
Give your requirements.txt
file (don't pip freeze
, instead give direct packages):
just the flet
Operating system:
Windows 10
Additional environment details:
I haven't change anything in client\web\index.html
the resource KFOmCnqEu92Fr1Me5WZLCzYlKw.ttf and canvaskit.js file Reference occurs at build to web with canvas
detail in there
flutter/flutter#104399
Add the following selection during compilation:
--dart-define=FLUTTER_WEB_CANVASKIT_URL=/canvaskit/
There is another question about font files
When the browser page opens,
Before loading the KFomCnqEu92Fr1Me5WZLCzYlKw.ttf font file
Non English fonts will display garbled characters. When the font file is loaded, it will be displayed normally in just a few minutes