-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
[web] support bundling CanvasKit instead of CDN #70101
Comments
This will be useful but it should definitely be made optional, since it will increase the (already big) app size even more |
@sidrao2006 the binary will be the same size whether you download from a CDN or your own server |
We should support building an app with a bundled version of CanvasKit. However, you can achieve it today with some manual effort. Simply pass |
@yjbanov will. I be able to specify for example |
Unfortunately, that doesn't seem to have any effect. For example: above command still loads the default 0.19.0 from I also cannot find any reference to this specific Dart define in code. |
The value should be https://unpkg.com/canvaskit-wasm@0.20.0/bin/ (i.e. no |
Added this to the PWA project because this is required in order to support fully offline apps out-of-the-box. |
Same problem for me. |
this setting will only work in release/profile mode. in debug mode the engine is prebuilt so the string cannot be changed. |
Similar issue loading fonts at #77580 |
While we are in the workaround state: |
@Wissperwind: we take the version directly from the main.dart.js file and download this one locally. So the version can change and we will always use the correct one. We have this code in our pipeline:
|
just so I'm clear from all the discussions, a future version of flutter will support the caching of canvaskit so the CDN approach will not be used? |
Can someone please explain or link how the fix work? |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Use case
CanvasKit is currently being downloaded from the CDN resource, which can cause problems with very strict content security policies.
Since https://unpkg.com links used by Flutter point to the specific versions of CanvasKit WASM, whitelisting them manually to keep up-to-date is unfeasible (wildcarding is not always possible).
Proposal
Bundle it with the app - this was already mentioned regarding CanvasKit in similar issues, e.g. #53639 (comment)
The text was updated successfully, but these errors were encountered: