Skip to content

[Bug]: changing a file registered by this.addWatchFile does not trigger HMR #5220

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

See #5219

What is expected?

generateHmrPatch returns a value with fullReload: true

What is actually happening?

generateHmrPatch returns undefined

System Info

https://github.com/rolldown/rolldown/tree/49f5c23d1b73cf0013091735eb3f5e22de83b165

Any additional comments?

I think generateHmrPatch is returning undefined because this part does not check the watched files.

for changed_file_path in changed_file_paths {
let changed_file_path = ArcStr::from(changed_file_path);
if let Some(module_idx) = self.module_idx_by_abs_path.get(&changed_file_path) {
changed_modules.insert(*module_idx);
}
}

Watch mode handles this in a completely different way, so I'm not sure how this should be fixed.

let mode =
if !self.options.experimental.is_incremental_build_enabled() || changed_ids.is_empty() {
ScanMode::Full
} else {
ScanMode::Partial(changed_ids)
};

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions