{"id":47584,"library":"fetch-everywhere","title":"fetch-everywhere","description":"Isomorphic WHATWG Fetch API that works in node.js, browsers, webpack, browserify, and react-native by providing a global fetch function. Version 1.0.5, last updated in 2016. Built on top of isomorphic-fetch and GitHub's WHATWG Fetch polyfill. Key differentiator: claims to support all JavaScript environments without per-environment configuration. However, the package is minimally maintained and depends on the outdated isomorphic-fetch; modern Node.js versions (18+) include native fetch, making this polyfill obsolete for most use cases.","status":"deprecated","version":"1.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/lucasfeliciano/fetch-everywhere","tags":["javascript","fetch","isomorphic-fetch","http","request","webpack","browserify","react-native","browser"],"install":[{"cmd":"npm install fetch-everywhere","lang":"bash","label":"npm"},{"cmd":"yarn add fetch-everywhere","lang":"bash","label":"yarn"},{"cmd":"pnpm add fetch-everywhere","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Promise polyfill in environments without native Promise support (e.g., older Node). fetch-everywhere does not bundle a promise polyfill.","package":"es6-promise","optional":true}],"imports":[{"note":"This package sets fetch as a global, not a named export. In ESM, use a side-effect import. In CJS, require and call fetch globally.","wrong":"import { fetch } from 'fetch-everywhere';","symbol":"fetch (global)","correct":"import 'fetch-everywhere'; fetch('...');"},{"note":"The package does not export fetch; it only sets it globally. Assigned require will return an empty object.","wrong":"const fetch = require('fetch-everywhere');","symbol":"require('fetch-everywhere')","correct":"require('fetch-everywhere'); fetch('...');"},{"note":"These are also set globally, not exported. The package re-exports them from the underlying WHATWG polyfill.","wrong":"import { Headers } from 'fetch-everywhere';","symbol":"Head, Request, Response, Body","correct":"import 'fetch-everywhere'; console.log(typeof Headers, typeof Request, typeof Response);"}],"quickstart":{"code":"require('es6-promise').polyfill();\nrequire('fetch-everywhere');\n\nfetch('https://jsonplaceholder.typicode.com/posts/1')\n  .then(function(response) {\n    if (!response.ok) {\n      throw new Error('Network response was not ok');\n    }\n    return response.json();\n  })\n  .then(function(post) {\n    console.log(post.title);\n  })\n  .catch(function(error) {\n    console.error('Fetch failed:', error);\n  });","lang":"javascript","description":"Demonstrates fetching data from a public API after polyfilling Promise and importing fetch-everywhere to set global fetch."},"warnings":[{"fix":"In Node 18+, remove fetch-everywhere and use global fetch directly. For older environments, consider using 'node-fetch' (CJS) or 'undici' (ESM).","message":"Package is outdated; modern Node.js (>=18) has native fetch. Use built-in fetch instead.","severity":"deprecated","affected_versions":"all"},{"fix":"Use a side-effect import (import 'fetch-everywhere') or require() without assignment.","message":"Does not export fetch; it only applies fetch to global scope. Attempting to destructure import will result in undefined.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Install and polyfill es6-promise or promise before loading fetch-everywhere.","message":"Must polyfill Promise manually if not available (e.g., Node 0.12). Package does not include a Promise polyfill.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'node-fetch' for full Node.js spec-compliant fetch.","message":"Depends on 'isomorphic-fetch' which has known issues with binary data and streaming.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to a maintained fetch polyfill or use native fetch.","message":"The GitHub repo is archived; no further updates or security fixes.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.5':26 '18':74 '2016':30 'api':7 'browser':12,98 'browserifi':14,94 'built':31 'case':85 'claim':46 'configur':56 'depend':64 'differenti':45 'environ':51,55 'everywher':3 'fetch':2,6,23,37,42,70,77,87,90 'fetch-everywher':1 'function':24 'github':39 'global':22 'howev':57 'http':91 'includ':75 'isomorph':4,36,69,89 'isomorphic-fetch':35,68,88 'javascript':50,86 'key':44 'last':27 'maintain':62 'make':78 'minim':61 'modern':71 'nativ':18,76,97 'node.js':11,72 'obsolet':81 'outdat':67 'packag':59 'per':54 'per-environ':53 'polyfil':43,80 'provid':20 'react':17,96 'react-nat':16,95 'request':92 'support':48 'top':33 'updat':28 'use':84 'version':25,73 'webpack':13,93 'whatwg':5,41 'without':52 'work':9","created_at":"2026-06-07T16:52:15.653846+00:00","updated_at":"2026-06-07T16:52:15.653846+00:00","problems":[{"fix":"Ensure you have a side-effect import: require('fetch-everywhere') or import 'fetch-everywhere' at the top of your entry file.","cause":"The package wasn't imported before calling fetch, or it was imported incorrectly (e.g., destructured).","error":"TypeError: fetch is not a function"},{"fix":"Run: npm install es6-promise","cause":"fetch-everywhere requires es6-promise for older environments but does not include it as a dependency.","error":"Cannot find module 'es6-promise'"},{"fix":"Import fetch-everywhere at the entry point of your application before any fetch calls.","cause":"Trying to use fetch in a browser that doesn't support it or before the polyfill is loaded.","error":"ReferenceError: fetch is not defined"},{"fix":"Remove fetch-everywhere and use native fetch (Node 18+) or node-fetch.","cause":"The package is no longer maintained and is not recommended for new projects.","error":"Warning: fetch-everywhere is deprecated. Please use native fetch or a modern alternative."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/lucasfeliciano/fetch-everywhere/issues","github":"https://github.com/lucasfeliciano/fetch-everywhere","docs":null,"changelog":null,"pypi":null,"npm":"fetch-everywhere","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}