ember-cli / ember-cli/loader.js

loader is failing to load an ES6 module

オープン
#119 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
79
フォーク
69
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

loader.js から始め、特に missingModule 関数とレポートで言及されているレジストリを確認してください。moment-range の import エラーを再現し、ES6 モジュールに対して想定される処理を特定してください。報告された import の挙動が解決されたことを確認し、リポジトリに適切な回帰チェックが用意されている場合はそれも行えば、完了とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。