Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the absence of a network, some resources cannot be found in the browser, and desktop applications are good #3278

Open
NocoleNe opened this issue May 12, 2024 · 3 comments

Comments

@NocoleNe
Copy link

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:

@ndonkoHenri
Copy link
Collaborator

Similar/related issue #2022.
In your case, the canvaskit web renderer (the default on web) is being used. Can you tell me what happens when you instead use the html renderer?

@NocoleNe
Copy link
Author

NocoleNe commented May 13, 2024

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

@NocoleNe
Copy link
Author

Similar/related issue #2022. In your case, the canvaskit web renderer (the default on web) is being used. Can you tell me what happens when you instead use the html renderer?

use the html renderer are ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants