Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error uploading image: Error: Either AngularFireModule has not been provided in your AppModule ( project v17 standalone) #3552

Open
thanhnguyen568 opened this issue Jun 22, 2024 · 3 comments

Comments

@thanhnguyen568
Copy link

Version info

**Angular: 17.3.0 **

Firebase: 10.12.2

AngularFire: 17.1.0

Debug output

** Errors in the JavaScript console:
Error uploading image: Error: Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).
at getSchedulers (angular-fire.mjs:142:11)
at runOutsideAngular (angular-fire.mjs:148:10)
at angular-fire.mjs:216:17
at _UploadService. (upload.service.ts:15:23)
at Generator.next ()
at main.js:18:61
at new ZoneAwarePromise (zone.js:2611:25)
at __async (main.js:2:10)
at _UploadService.uploadFile (upload.service.ts:12:30)
at _DialogExaminationFormUpdateComponent. (dialog-examination-form-update.component.ts:125:54)
**

** Screenshots
image
**

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@BurscherChris
Copy link

It could be that you are using getAuth(), getStorage(), or getFireStore() within a service or component.

I encountered a similar issue when I was using getAuth() directly in my service like this:

const auth = getAuth();
const uc = await signInWithEmailAndPassword(auth, email, password);

After modifying my approach to the following, my code started working correctly:

constructor(private _auth: AngularFireAuth) {}

...

const uc = await this._auth.signInWithEmailAndPassword(email, password);

I hope this helps!

@KingDarBoja
Copy link
Contributor

Just in case, try to remove node_modules and yarn.lock or package-lock.json and do a fresh install as sometimes there are multiple firebase versions being called without noticing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants