Could not find module `rxjs` imported from `adn-components/components/form-select`

My ember addon version is 3.8.3. I have added rxjs as a dependency and tried to use it into a component.

import { Observable } from 'rxjs';

When I try to run the app, I am getting the following error

Could not find module rxjs imported from adn-components/components/form-select.

package.json

"dependencies": {
"ember-ajax": "5.0.0",
"ember-cli-babel": "7.8.0",
"ember-cli-htmlbars": "3.1.0",
"ember-cli-moment-shim": "3.7.1",
"ember-cli-sass": "10.0.1",
"ember-concurrency": "1.1.0",
"ember-cp-validations": "4.0.0-beta.9",
"ember-file-upload": "2.7.1",
"ember-inputmask": "0.9.1",
"ember-jquery-legacy": "1.0.0",
"ember-lifeline": "4.1.5",
"ember-moment": "7.8.1",
"ember-power-select": "2.3.5",
"ember-responsive": "3.0.5",
"ember-wormhole": "0.5.5",
"liquid-fire": "0.30.0",
"pretty-quick": "1.11.1",
"rxjs": "6.5.4",
"sass": "1.22.7"

}

Hi @RAJA_S, welcome! Ember (currently) relies on some build time magic which means that by itself Ember cannot import arbitrary js packages like this, however there is an awesome addon called ember-auto-import which will allow you to do this. So I think all you should have to do to get this to work is run

ember install ember-auto-import

and then try restarting your development server

If you’re interested there’s a project underway to overhaul the Ember build system called Embroider, and IIRC that will allow imports like this in the future without the need for ember-auto-import. It will also support a lot of other great features like codesplitting too

1 Like

Thanks a lot! Your Suggested solution is working fine :raised_hands: