Operating System
N/A
Browser Version
N/A
Firebase SDK Version
[email protected], @firebase/[email protected]
Firebase SDK Product:
Auth
Describe your project's tooling
Next.js with Vercel Edge runtime.
Describe the problem
When running Firebase, I get the following error:
@firebase/auth: Auth (10.3.0): INTERNAL ASSERTION FAILED: Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill
Steps and code to reproduce issue
I checked the code and I believe it's quite simple to verify this is a bug, and I will describe it below. Thus I don't provide a detailed repilication. Let me know if you still want me to prepare a minimal repo to reproduce this bug.
- The package
@firebase/[email protected]
provides multiple exports, shown in its package.json. One of them is dist/esm2017/index.js
.
dist/esm2017/index.js
just re-exports some objects from dist/esm2017/index-9a76d29a.js
.
dist/esm2017/index-9a76d29a.js
defines class FetchProvider
at line 742, and calls FetchProvider.fetch()
at line 915 and line 1470. However, FetchProvider.initialize()
has never been called in this file, and self
is not a standard JavaScript global property (it only exists in browser environment). That's why I get this error.