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:
import { _decorator, Component, Node } from 'cc';
import { initializeApp } from 'firebase/app'
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
const { ccclass, property } = _decorator;
@ccclass('Test')
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)