Skip to content

Firebase init takes 20s more by "FirebaseAppCheckTokenProvider AppCheck not yet detected" #8381

@xianbinKit

Description

@xianbinKit

Operating System

macOS Sonoma 14.2

Browser Version

Chrome Version 125.0.6422.142 (Official Build) (arm64)

Firebase SDK Version

10.12.4

Firebase SDK Product:

Firestore

Describe your project's tooling

Nuxtjs 3 + firebase javascript sdk

Describe the problem

firebase init takes 20 more seconds before first getDoc, please see firebase debug log below.

App Check is not active on firebase web console. I don't know where the "FirebaseAppCheckTokenProvider AppCheck" from

I have tried firebase v10.12.3, same issue.

I have tried another web using same firebase project and same version ( 10.12.3), another version is very fast.

the only different is : there is a warning "Third-party cookie will be blocked. Learn more in the Issues tab." in the one which has issue.

Tried Safari : no problem, no Third-party cookie warning
Tried in Chrome incognito tab: no problem, no Third-party cookie warning

Steps and code to reproduce issue

import { initializeApp } from 'firebase/app'
import { getAuth } from "firebase/auth"
import { getFirestore, setLogLevel } from 'firebase/firestore'
import { getAnalytics } from "firebase/analytics"




export default defineNuxtPlugin(nuxtApp => {
    const config = useRuntimeConfig()

    const firebaseConfig = {
        apiKey: import.meta.env.VITE_FIREBASE_apiKey,
        authDomain: import.meta.env.VITE_FIREBASE_authDomain,
        projectId: import.meta.env.VITE_FIREBASE_projectId,
        storageBucket: import.meta.env.VITE_FIREBASE_storageBucket,
        messagingSenderId: import.meta.env.VITE_FIREBASE_messagingSenderId,
        appId: import.meta.env.VITE_FIREBASE_appId,
        measurementId: import.meta.env.VITE_FIREBASE_measurementId
    };

    const app = initializeApp(firebaseConfig)
    console.log('firebase init')
    // const analytics = getAnalytics(app)
    const auth = getAuth(app)
   
    const firestore = getFirestore(app)
    setLogLevel('debug')

    nuxtApp.vueApp.provide('auth', auth)
    nuxtApp.provide('auth', auth)

    nuxtApp.vueApp.provide('firestore', firestore)
    nuxtApp.provide('firestore', firestore)
})

// call getDoc somewhere on index.vue...

[2024-07-19T21:53:32.630Z] @firebase/firestore: Firestore (10.12.4): FirebaseAppCheckTokenProvider AppCheck not yet detected chunk-JCLT2C3F.js?v=e727d07d:1375

===== >here took 21 seconds

Third-party cookie will be blocked. Learn more in the Issues tab. ( only shows this warning on this project )

[2024-07-19T21:53:54.128Z] @firebase/firestore: Firestore (10.12.4): AsyncQueue Visibility state changed to hidden
localhost/:1 Third-party cookie will be blocked. Learn more in the Issues tab. chunk-JCLT2C3F.js?v=e727d07d:1375

========> here took 5 seconds

[2024-07-19T21:53:59.058Z] @firebase/firestore: Firestore (10.12.4): FirestoreClient Received user= IFMJD5alI8RPwWCTVxD1XXqVvtw2 chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.059Z] @firebase/firestore: Firestore (10.12.4): FirestoreClient Using default OnlineComponentProvider chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.059Z] @firebase/firestore: Firestore (10.12.4): FirestoreClient Using default OfflineComponentProvider
chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.059Z] @firebase/firestore: Firestore (10.12.4): FirestoreClient Initializing OfflineComponentProvider
chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.059Z] @firebase/firestore: Firestore (10.12.4): FirestoreClient Initializing OnlineComponentProvider
chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.060Z] @firebase/firestore: Firestore (10.12.4): MemoryPersistence Starting transaction: Allocate target
chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.061Z] @firebase/firestore: Firestore (10.12.4): MemoryPersistence Starting transaction: Execute query
chunk-JCLT2C3F.js?v=e727d07d:1375

[2024-07-19T21:53:59.061Z] @firebase/firestore: Firestore (10.12.4): QueryEngine Using full collection scan to execute query: Query(target=Target(globalSettings/productsSettings, orderBy: [name (asc)]); limitType=F)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions