Skip to content

[CP][web] Fix paths fetched by flutter.js #120197

@mdebbar

Description

@mdebbar

issue_link

#116360

Commit Hash

3bf7960

Target

stable

pr_link

#120195

Impacted Users

All flutter web devs that use PathUrlStrategy

Impact Description

The flutter web app won't load if accessed through any path other than /.

Workaround

Yes, there's a workaround that requires messing with the build output files. They basically need to fork the flutter.js file, apply the fix there, and load the forked file instead of the flutter-tool-generated one.

Although the workaround fixes the issue, I don't recommend it because the app won't pick up any future changes that we make in flutter.js, which could lead to mysterious bugs that are hard to track.

Risk

low

Test Coverage

yes

Validation Steps

  1. Create a sample app.
  2. Use PathUrlStrategy.
  3. Load the app at a non-root path (e.g. http://localhost:xxxxx/a/b/)
  4. The app should load and work.

Metadata

Metadata

Labels

cp: approvedApproved cherry-pick requestcp: merge-to-stableCherry-picks that should be merged to stablecp: mergedCherry-pick has been merged to the release branch.cp: reviewCherry-picks in the review queue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions