Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix "global is not defined"#1704

Merged
jimmywarting merged 1 commit intonode-fetch:2.xfrom
segevfiner:patch-1
Jan 30, 2023
Merged

Fix "global is not defined"#1704
jimmywarting merged 1 commit intonode-fetch:2.xfrom
segevfiner:patch-1

Conversation

Copy link

segevfiner commented Jan 18, 2023

Purpose

I think this was missed in #1534

Changes

Replace global -> globalObject

Additional information

I get a global is not defined error otherwise. (octokit is still using this instead of isomorphic-fetch/cross-fetch)

NewEraCracker reacted with thumbs up emoji
LinusU approved these changes Jan 19, 2023
Copy link
Member

LinusU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

jimmywarting commented Jan 19, 2023 *
edited
Loading

I think we should remove getGlobal and just use globalThis instead. and do we really need to use bind?

All in all:

"use strict";

const { fetch, Headers, Request, Response } = globalThis;

module.exports = exports = fetch;

// Needed for TypeScript and Webpack.
if (fetch) {
exports.default = fetch;
}

exports.Headers = Headers;
exports.Request = Request;
exports.Response = Response;

NewEraCracker approved these changes Jan 30, 2023
Copy link
Member

LinusU commented Jan 30, 2023

@jimmywarting what do you think about releasing this PR as is, and then someone can open a new PR for further changes?

NewEraCracker reacted with thumbs up emoji

Copy link
Collaborator

jimmywarting commented Jan 30, 2023

sure

NewEraCracker reacted with thumbs up emoji

jimmywarting approved these changes Jan 30, 2023
jimmywarting merged commit 70f592d into node-fetch:2.x Jan 30, 2023
Copy link

github-actions bot commented Jan 30, 2023

This PR is included in version 2.6.9

The release is available on:

Your semantic-release bot

NewEraCracker reacted with hooray emoji

github-actions bot added the released on @2.x label Jan 30, 2023
Brynor approved these changes Feb 20, 2023
Bad3r mentioned this pull request May 22, 2024
snyk-io bot mentioned this pull request Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

LinusU LinusU approved these changes

jimmywarting jimmywarting approved these changes

+2 more reviewers

NewEraCracker NewEraCracker approved these changes

Brynor Brynor approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants