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

Fix the import of node-fetch polyfill #5399

Merged
merged 2 commits into from
Aug 30, 2021
Merged

Fix the import of node-fetch polyfill #5399

merged 2 commits into from
Aug 30, 2021

Conversation

jamesdaniels
Copy link
Member

Storage and FirestoreLite were importing node-fetch as a namespace, rather than pulling the default fetch function and using that.

// import * as nodeFetch from 'node-fetch';
Object [Module] {
  default: [Getter],
  Headers: [Getter],
  Request: [Getter],
  Response: [Getter],
  FetchError: [Getter]
}
// import nodeFetch from 'node-fetch';
[Function: fetch] {
  isRedirect: [Function (anonymous)],
  Promise: [Function: ZoneAwarePromise] {
    toString: [Function (anonymous)],
    resolve: [Function (anonymous)],
    reject: [Function (anonymous)],
    race: [Function (anonymous)],
    all: [Function (anonymous)],
    allSettled: [Function (anonymous)],
    allWithCallback: [Function (anonymous)],
    __zone_symbol__uncaughtPromiseErrors: []
  }
}

This was leading to timeouts in Storage node and uncaught exceptions in Firestore Lite @firebase/firestore: Firestore (9.0.0_lite): RPC_ERROR HTTP error has no status diving in and setting a breakpoint I found this underlying error TypeError: this.fetchImpl is not a function

@changeset-bot
Copy link

changeset-bot bot commented Aug 27, 2021

🦋 Changeset detected

Latest commit: 14bf97c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@firebase/firestore Patch
@firebase/storage Patch
firebase Patch
@firebase/firestore-compat Patch
@firebase/storage-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 27, 2021

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 27, 2021

Size Analysis Report

Affected Products

No changes between base commit (509c18f) and head commit (396053f).

@Feiyang1
Copy link
Member

fyi, @schmidt-sebastian

@Feiyang1 Feiyang1 merged commit 6163bb2 into master Aug 30, 2021
@Feiyang1 Feiyang1 deleted the nodeFetchBug branch August 30, 2021 17:37
@google-oss-bot google-oss-bot mentioned this pull request Aug 30, 2021
@firebase firebase locked and limited conversation to collaborators Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants