ember-cli / ember-ajax

Service for making AJAX requests in Ember applications
MIT License
212 stars 87 forks source link

importing `ember-ajax/errors` is broken with `ember-cli-typescript` #437

Closed sumeetattree closed 5 years ago

sumeetattree commented 5 years ago

Checked against master. Trying to import { AjaxError } from 'ember-ajax/errors'; is broken while using ember-cli-typescript

ember: ~3.8.0 ember-cli: ~3.8.1 ember-ajax: ^4.0.2 and master ember-cli-typescript: v2.0.0-rc2

Might be related to #428

rwjblue commented 5 years ago

Can you please define what specifically is broken? Does it not compile? Does it emit compilation warnings/errors? Does it compile but error at runtime?

sumeetattree commented 5 years ago

Sorry my bad. It compiles just fine. But when the route tries to import, it errors at run time with

"Cannot import module from 'ember-ajax/errors'"

Only occurs with typescript. Otherwise it works just fine.

So here's a little bit of a background. I am trying to convert one of the in-repo-engine to use typescript. The base app and another in-repo-addon that hosts the shared code, are both written in Javascript. This shared addon is exposing ember-ajax.

When I try to compile and run with typescript I face #428 and this issue. While #428 seems to be resolved in master, this issue remains.

boris-petrov commented 5 years ago

@sumeetattree - can you try ember-ajax version 5? I'm using also ember-cli-typescript and I don't have that problem.

sumeetattree commented 5 years ago

Tested with 5.0.0. It is working. Thank you!