Canonicalize the root path to match the canonicalized asset path. (#18345)

# Objective

- Fixes #18342.

## Solution

- Canonicalize the root path so that when we try to strip the prefix, it
matches the canonicalized asset path.
- This is basically just a followup to #18023.

## Testing

- Ran the hot_asset_reloading example and it no longer panics.
This commit is contained in:
andriyDev 2025-03-16 14:03:29 -07:00 committed by GitHub
parent 6b61e38011
commit 9bcaad7b43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,7 @@ impl FileWatcher {
sender: Sender<AssetSourceEvent>,
debounce_wait_time: Duration,
) -> Result<Self, notify::Error> {
let root = normalize_path(&path);
let root = normalize_path(&path).canonicalize().unwrap();
let watcher = new_asset_event_debouncer(
path.clone(),
debounce_wait_time,