Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

loader is failing to load an ES6 module

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript
领域
tooling

调研方向

从 loader.js 开始,重点查看 missingModule 函数以及报告中提到的注册表。重现 moment-range 的导入错误,并确定对 ES6 模块的预期处理方式;如果已确认报告中的导入行为得到解决,并且 repository 提供了适当的回归检查,则视为完成。

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

描述

In my project we're using moment-range, which got an update in it's version 3 to be an ES6 module.

Previously we'd been loading it using ember-browserify and thus were doing import DateRange from 'npm:moment-range'. This doesn't work with the updated version, as one will get the error TypeError: _npmMomentRange.default is not a constructor, presumably as there's no default export on the module. Besides, as it's an ES6 module from what I understand the npm: prefix shouldn't be necessary.

Omitting the npm: prefix however gives a different error:
Error: Could not find module 'moment-range' imported from 'foo/bar/baz'
which is thrown by the missingModule function in loader.js. Poking about a bit, there's no sign of moment-range in the registry inside loader.js.

I may well be doing something wrong, but I'm at a loss to see what I should be doing differently.

Any suggestions?

主要语言
JavaScript
星标
79
派生
69
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

ember-cli/loader.js 的其他 Issue

查看 ember-cli/loader.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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