You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final url =versionJsonUrl(web.window.document.baseURI, cacheBuster);
Instead to get the base URI using some Flutter API, it is being fetched using a web specific API, which returns the URL used in that moment by the browser, what as we could see previously, that URL could not be where the Flutter app is actually deployed.
Code Sample
No response
Logs
NA
Flutter Doctor
NA
Checklist before submitting a bug
I searched issues in this repository and couldn't find such bug/problem
I Google'd a solution and I couldn't find it
I searched on StackOverflow for a solution and I couldn't find it
I read the README.md file of the plugin
I'm using the latest version of the plugin
All dependencies are up to date with flutter pub upgrade
I did a flutter clean
I tried running the example project
The text was updated successfully, but these errors were encountered:
I sent a PR (#2733) using the AssetManager to achieve the same result as the current implementation, but supporting in this way setups where the app is server from a different domain.
Flutter doesn't have a explicit public API to get this base URL, but with a little hack (using public API) it was possible to get it.
Would be providing an optional parameter in static Future<PackageInfo> fromPlatform() with the custom version.json url enough to bypass this issue?
If the current implementation sent in the PR is not valid or good, I can take a look to change to this approach.
Platform
Any web browser
Plugin
package_info_plus
Version
5.0.1
Flutter SDK
3.7.0 and above
Steps to reproduce
Introduction
As of Flutter 3.7.0, Flutter allow us to pass an assetBase value when the Flutter web engine is initialized:
This allow us to load the application from a domain my-business-domain.com when the application is actually deployed in other one my-app-domain.com
Bug
Having the next domains:
package_info_plus is failing because it is trying to load the file version.json using the second domain instead the first one
Other users are having the same issue: #1409 (comment)
The problem of this issue is here:
plus_plugins/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart
Line 54 in a3cd72f
Instead to get the base URI using some Flutter API, it is being fetched using a web specific API, which returns the URL used in that moment by the browser, what as we could see previously, that URL could not be where the Flutter app is actually deployed.
Code Sample
No response
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: