Skip to content

[web] base url has incorrect hash if assets contain multiple index.html #136593

@p-mazhnik

Description

@p-mazhnik

Is there an existing issue for this?

Steps to reproduce

  1. Create a new web project with flutter create.
  2. Create and register asset with the name index.html
mkdir assets && touch assets/index.html
# pubspec.yaml

flutter:
  uses-material-design: true
+ assets:
+   - assets/index.html
  1. build web app, flutter build web
  2. open build/web/flutter_service_worker.js

Expected results

In the RESOURCES map, index.html and / keys should have the same value (hash)

Actual results

In the RESOURCES map, index.html and / keys have different values. / has the same value as assets/assets/index.html.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.13.4, on macOS 13.3.1 22E772610a darwin-arm64)
    • Flutter version 3.13.4 on channel stable at /Users/mazhnik/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (5 weeks ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/mazhnik/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = /Users/mazhnik/Library/Android/sdk
    • Java binary at: /Users/mazhnik/Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/mazhnik/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
    • IntelliJ at /Users/mazhnik/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 75.1.4
    • Dart plugin version 232.9559.10

[✓] VS Code (version 1.73.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.52.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.3.1 22E772610a
      darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 118.0.5993.70

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Labels

P2Important issues not at the top of the work listfound in release: 3.13Found to occur in 3.13found in release: 3.16Found to occur in 3.16fyi-webFor the attention of Web platform teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions