Skip to content

Flutter Web fails to load shader assets containing spaces in file names #180862

Description

@Laurie-Lin

Steps to reproduce

  1. Clone the repository: git clone https://github.com/nightmare-space/shader_graph
  2. Change to version tag v0.1.0: git checkout v0.1.0
  3. Run the example project on web: cd shader_graph/example && flutter run -d chrome

Expected results

Shader assets with spaces in file names should load successfully on Flutter Web, just as they do on other platforms (iOS, Android, desktop).

Actual results

[log] Error loading shader program from shaders/wrap/Wrap Debug.frag: Flutter Web engine failed to fetch "assets/shaders/wrap/Wrap%20Debug.frag". HTTP request succeeded, but the server responded with HTTP status 404.

Code sample

See example

Logs

Logs
Restarted application in 100ms.
3
[log] Error loading shader program from shaders/wrap/Wrap Debug.frag: Flutter Web engine failed to fetch "assets/shaders/wrap/Wrap%20Debug.frag". HTTP request succeeded, but the server responded with HTTP status 404.

Flutter Doctor output

Doctor output
shader_graph git:(main) ✗ flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.4, on macOS 26.2 25C56 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.1.1)
[✓] Chrome - develop for the web
[✓] Proxy Configuration
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Additional notes

  1. The issue appears to be specific to Flutter Web. The same shader assets load correctly on other platforms (iOS, Android, macOS, Windows, Linux).
  2. The problem occurs with ui.FragmentProgram.fromAsset() when loading shader assets.
  3. Workaround: Rename shader files to use underscores or hyphens instead of spaces (e.g., "Wrap_Debug.frag" or "Wrap-Debug.frag").
  4. This issue only affects shader files whose filenames contain spaces, rather than all assets with spaces in their names.

Metadata

Metadata

Assignees

Labels

c: renderingUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.found in release: 3.38Found to occur in 3.38found in release: 3.40Found to occur in 3.40has 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-webOwned by Web platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions