bevyengine / bevyengine/bevy

Filesystem watcher fails for assets not in root path

Open
#2,729 6 comments 1 reaction 0 assignees View on GitHub
A-Assets C-Docs
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.5 (Confirmed code same in `main` branch though)

## Operating system & version

Windows 11

## What you did

- Loaded asset from an absolute path, which was not under the `assets` folder, using `asset_server.load()`.
- Called `asset_server.watch_for_changes()`
- After successful initial load, changed file contents.

## What you expected to happen

The asset should reload

## What actually happened

Bevy panicked:
```
thread 'Compute Task Pool (3)' panicked at 'called `Result::unwrap()` on an `Err` value: StripPrefixError(())', ...
```

at https://github.com/bevyengine/bevy/blob/c5717b5a9124c7c2f7431c4be07f15243ebd60b5/crates/bevy_asset/src/io/file_asset_io.rs#L135

## Additional information

The file watcher incorrectly assumes all assets must exist below the `assets` folder.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.