ember-cli / ember-cli/loader.js

loader is failing to load an ES6 module

Abierto
#119 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
79
Forks
69
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Empieza por loader.js, especialmente por la función missingModule y el registro mencionado en el informe. Reproduce los errores de importación de moment-range y determina el comportamiento esperado para un módulo ES6; se considerará hecho cuando se haya confirmado la resolución del comportamiento de importación informado, con una comprobación de regresión adecuada si el repositorio proporciona una.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.