Emberfire configuration with ember project

I want to configure firebase with my ember project. So I create new ember project. The project was working correctly. But after installing ‘emberfire’ using “ember install emberfire” I facing this error "Uncaught Error: Could not find module ember imported from emberfire/initializers/emberfire". Please give me the solution for solving this error. Thank you.

What version of emberfire do you have installed? My guess is you’re in the 2.x series which is probably still the npm “latest” but that is incompatible with newer Ember versions. They’ve been updating emberfire and working on a version 3 but it’s been slow and it hasn’t officially landed yet, looks like it’s still release candidate stage.

Try installing “3.0.0-rc.6” and see what happens?

1 Like

Maybe also take a look at ember-pouch for we are actively developing it and it supports Offline First Eventually Consistent relational ember-data models. It can be used with the free IBM Cloudant or the free CloudStation

1 Like

I couldn’t install it. i have this error

":construction: Installing packages… This might take a couple of minutes. Command failed: npm install --save-dev --loglevel error emberfire@^3.0.0 npm ERR! code ETARGET npm ERR! notarget No matching version found for emberfire@^3.0.0. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn’t exist.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/siva/.npm/_logs/2020-03-19T04_44_19_727Z-debug.log.

Now what can i do?

3.0.0-rc.6 seems to be on NPM. Maybe try npm install emberfire@3.0.0-rc.6 --save-dev?

1 Like

Yes you’ll need the rc bit at the end as well since it’s not a full release yet. You could also just put that in your package.json manually and run npm install

1 Like

Ya its Working. Thanks a lot.

1 Like

thanks a lot @dknutsen

Now I’m facing another error. "Uncaught Error: Could not find module emberfire/adapters/firebase imported from ember-task-two/adapters/application"

My Inspect source window.

Thank you.

In the new version of the emberfire addon there is no adapter called “firebase”, there are two adapters, one for each database type: “firestore” and “realtime-database”. Following the README is probably your best bet to get things set up properly since it has changed significantly since the v2 series (and so has ember, and so has firebase itself).

So anyway to fix the error you currently have you’ll want to change your application adapter import from

"emberfire/adapters/firebase"

to:

"emberfire/adapters/firestore"
// or
"emberfire/adapters/realtime-database"

depending on which firebase database type you’ll be using.