ember-cli / ember-cli/loader.js

loader is failing to load an ES6 module

Ouverte
#119 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
79
Forks
69
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par loader.js, en particulier la fonction missingModule et le registre mentionné dans le rapport. Reproduisez les erreurs d’importation de moment-range et déterminez le comportement attendu pour un module ES6 ; le travail sera considéré comme terminé lorsqu’une résolution confirmée du comportement d’importation signalé aura été obtenue, avec une vérification de régression appropriée si le dépôt en fournit une.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.