`esm_loader` should use a primordial to get `cwd`
未关闭
还没有人认领这个 Issue。
loaders
never-stale
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
Version
v18.9.0
Platform
Linux vhost1 5.18.10-76051810-generic #202207071639~1657252310~22.04~7d5e891 SMP PREEMPT_DYNAMIC Fri J x86_64 x86_64 x86_64 GNU/Linux
Subsystem
esm_loader
What steps will reproduce the bug?
process.cwd = () => {
(async () => {
await import('.');
})();
};
await import('.');
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
No RangeErrors.
What do you see instead?
Exception in PromiseRejectCallback:
node:internal/modules/esm/resolve:1110
};
RangeError: Maximum call stack size exceeded
Exception in PromiseRejectCallback:
node:internal/modules/esm/loader:163
const output = await hook(arg0, meta.context, nextNextHook);
Additional information
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在 Node.js v18.9.0 上运行提供的复现,然后检查 stack trace 所指位置的 node:internal/modules/esm/resolve.js 和 node:internal/modules/esm/loader.js。跟踪 esm_loader 如何获取 cwd,并将其更新为使用所请求的 primordial;当复现能够在没有 RangeErrors 的情况下完成时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100