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

fetch is not a function. #131

Merged
merged 1 commit into from
Nov 30, 2020
Merged

fetch is not a function. #131

merged 1 commit into from
Nov 30, 2020

Conversation

JJ-Kidd
Copy link
Contributor

@JJ-Kidd JJ-Kidd commented Nov 30, 2020

What

Adding .default to the import of node-fetch

Why

When this package is deployed as part of a Lambda function it is unable to find fetch, this is because it is loosely imported

Issue

#130

@callum-oakley
Copy link
Contributor

@JJ-Kidd thanks for the PR. I'm not opposed to merging this as is, but I'm keen to understand why it's required. Do you have any references or documentation on the "loose import" issue with Webpack? I have previously used this package on AWS Lambda without issue, though I don't remember using Webpack, so I guess Webpack is doing something weird...

@callum-oakley
Copy link
Contributor

Hah I found the history. From my initial reading of that issue it sounds like a bug with Webpack that shouldn't have been closed, and that library maintainers shouldn't be expected to account for. I'm going to begrudgingly merge this and add a comment detailing why it exists though. Thanks!

@callum-oakley callum-oakley merged commit d920dc2 into pusher:master Nov 30, 2020
@JJ-Kidd
Copy link
Contributor Author

JJ-Kidd commented Nov 30, 2020

Thanks @callum-oakley. Any idea when I'll be able to grab this as a tagged version?

@callum-oakley
Copy link
Contributor

I'll push a new release just as soon as the tests have passed on master, watch this space :)

@callum-oakley
Copy link
Contributor

Published as 4.0.2

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

Successfully merging this pull request may close these issues.

2 participants