`restrictions`: resolution of packages that have `exports` fields does not fall back correctly

未关闭
#267 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
rust
领域
tooling

调研方向

Start with the enhanced-resolve PR #600 and the linked repro commit, then trace rspack-resolver's restrictions handling for packages with exports and multiple modules entries. Add a regression test for the fallback scenario and verify that resolution proceeds to a later modules entry when the first result violates the restriction.

由索引模型根据 Issue 内容生成。

描述

rspack-resolver seems to have the same bug in restrictions handling that enhanced-resolve fixed here: https://github.com/webpack/enhanced-resolve/pull/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): https://github.com/bregenspan/rspack-resolver/commit/abaf51a5eeeca1c5ff029fbd270a6b632c959567

主要语言
Rust
星标
42
派生
10
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rstackjs/rspack-resolver 的其他 Issue

查看 rstackjs/rspack-resolver 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。