Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

5601 - fix next.js builds on node v16 #5619

Merged
merged 10 commits into from
Nov 21, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/web3-providers-http/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ var errors = require('web3-core-helpers').errors;
var http = require('http');
var https = require('https');

// check if node isn't being run
if (!typeof window === undefined) {
// Apply missing polyfill for IE
require('cross-fetch/polyfill');
require('es6-promise').polyfill();
require('abortcontroller-polyfill/dist/polyfill-patch-fetch');
} else {
const fetch = require('cross-fetch');
}

/**
* HttpProvider should be used to send rpc calls over http
Expand Down