Skip to content

Commit

Permalink
fix: imports for node-fetch when using webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskribl committed Mar 11, 2021
1 parent 462efcb commit 377a0cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ if (needTextEncoderPolyfill) {

import * as protobuf from 'protobufjs';
import * as gax from './gax';
import * as nodeFetch from 'node-fetch';
import nodeFetch from 'node-fetch';
import {Response as NodeFetchResponse} from 'node-fetch';
import * as routingHeader from './routingHeader';
import {AbortController as NodeAbortController} from 'abort-controller';
import {Status} from './status';
Expand Down Expand Up @@ -407,7 +408,7 @@ export class GrpcClient {
delete fetchRequest['body'];
}
fetch(url, fetchRequest)
.then((response: Response | nodeFetch.Response) => {
.then((response: Response | NodeFetchResponse) => {
return Promise.all([
Promise.resolve(response.ok),
response.arrayBuffer(),
Expand Down

0 comments on commit 377a0cb

Please sign in to comment.