rspack-resolver seems to have the same bug in restrictions handling that enhanced-resolve fixed here: webpack/enhanced-resolve#600. (An error is returned when attempting to resolve a package that has an exports field defined, instead of falling back to resolve from a subsequent entry in modules configuration.)
The case is the one described here: https://github.com/orgs/webpack/discussions/21080, where "modules" is configured as an array of two or more entries, and "restrictions" is defined in a way that means the first "modules" entry will produce a resolution that does not meet the restriction.
I do not know Rust, so ignore this is if it's not a helpful illustration, but here is a Claude-generated repro (porting the new test cases enhanced-resolve introduced for this issue, and highlighting the scenario that fails): bregenspan@abaf51a
rspack-resolverseems to have the same bug inrestrictionshandling thatenhanced-resolvefixed here: webpack/enhanced-resolve#600. (An error is returned when attempting to resolve a package that has anexportsfield defined, instead of falling back to resolve from a subsequent entry inmodulesconfiguration.)The case is the one described here: https://github.com/orgs/webpack/discussions/21080, where "modules" is configured as an array of two or more entries, and "restrictions" is defined in a way that means the first "modules" entry will produce a resolution that does not meet the restriction.
I do not know Rust, so ignore this is if it's not a helpful illustration, but here is a Claude-generated repro (porting the new test cases
enhanced-resolveintroduced for this issue, and highlighting the scenario that fails): bregenspan@abaf51a