How to implement firebase in Cocos Creator 3.x?

Hi guys, I’m having problems when trying to use firebase in Cocos Creator 3.x.
Initially, I was using npm install just like other modules
But it gave me these errors:

Code is just as simple as this:

import { _decorator, Component, Node } from 'cc';
import { initializeApp } from 'firebase/app'
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
const { ccclass, property } = _decorator;


export class Test extends Component {

    start() {

        const firebaseConfig = {


        const app = initializeApp(firebaseConfig);

        const db = getFirestore(app);



And then I decided to use other ways to implement the Firebase.
Just like the post here, the other firebase module still can’t be used (in this case, we are trying to use firestore)

Can someone help me with this issue?

1 Like

I will ask engineering to review this.

Importing firebase is not currently supported and is discussed similarly here.

Is there any workaround for this?
Or will it be supported in the near future?

And, we also tried to implement PlayFab to replace Firebase, but we encountered the same issues.

Not currently supported.