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

Wrong Setup in Index.ts #86

Open
thanh01pmt opened this issue Feb 20, 2021 · 2 comments
Open

Wrong Setup in Index.ts #86

thanh01pmt opened this issue Feb 20, 2021 · 2 comments

Comments

@thanh01pmt
Copy link

thanh01pmt commented Feb 20, 2021

There is no key "databaseURL" in "servicceAccount"
=> This affects to Initialize App when import Json to Firestore in my case.


export const initializeApp = (serviceAccount: object, name = '[DEFAULT]') => {
  if (
    admin.apps.length === 0 ||
    (admin.apps.length > 0 && admin.app().name !== name)
  ) {
    admin.initializeApp(
      {
        credential: admin.credential.cert(serviceAccount),
        databaseURL: serviceAccount['databaseURL'],
      },
      name
    )
    admin.firestore().settings({ timestampsInSnapshots: true })
  }
  return true
}
@dalenguyen
Copy link
Owner

Hi @thanh01pmt, can you add the databaseURL to your serviceAccount file?

Or initialize by using normal process, then you can use the backup & restore feature.

Let me know if it works.

@ilovealbasit
Copy link

@thanh01pmt

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

3 participants