DEV Community

Lumin
Lumin

Posted on

2 1

Fix Firebase error "auth/emulator-config-failed"

Official Document Said That

  • create app instance
  • create auth instance
  • then connect with emulator
const app = initializeApp(config.firebase)
const auth = getAuth(app)
connectAuthEmulator(auth, 'http://localhost:9099', { disableWarnings: true })
// note: 9099 is the default port Firebase used for their authen emulator
Enter fullscreen mode Exit fullscreen mode

But I got this when logged-in

Uncaught FirebaseError: Firebase: Error (auth/emulator-config-failed).
Enter fullscreen mode Exit fullscreen mode

Here's the Solution

From developer best friend Stackoverflow

async function setupEmulators(auth) {
  const authUrl = 'http://localhost:9099'
  await fetch(authUrl)
  connectAuthEmulator(auth, 'http://localhost:9099', { disableWarnings: true })
  // why? to make sure that emulator are loaded
}

const app = initializeApp(config.firebase)
const auth = getAuth(app)
setupEmulators(auth)
Enter fullscreen mode Exit fullscreen mode

Happy

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (1)

Collapse
 
palexandrite profile image
Alexander Bulatov

Thanks a lot!

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up