{"id":48201,"library":"isomorphic-fetch-ponyfill","title":"isomorphic-fetch-ponyfill","description":"A fetch ponyfill that works across Node.js, browsers, React Native, and Cloudflare Workers. Version 0.3.18 provides a simple, no-dependency implementation of the Fetch API designed as a proper ponyfill (does not pollute globals). It is isolated from the environment's native fetch, making it suitable for sandboxed runtimes like Cloudflare Workers. Unlike cross-fetch, it works in Workers by avoiding Node-specific dependencies. Release cadence is low; the package is stable but not actively developed. The name includes 'ponyfill' to indicate it replaces the global fetch only when explicitly imported, avoiding side effects.","status":"active","version":"0.3.18","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","discord","interactions","slash commands","framework","api","wrapper","typescript"],"install":[{"cmd":"npm install isomorphic-fetch-ponyfill","lang":"bash","label":"npm"},{"cmd":"yarn add isomorphic-fetch-ponyfill","lang":"bash","label":"yarn"},{"cmd":"pnpm add isomorphic-fetch-ponyfill","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a named export, not a default export. CommonJS users can use const { fetch } = require('isomorphic-fetch-ponyfill').","wrong":"import fetch from 'isomorphic-fetch-ponyfill'","symbol":"fetch","correct":"import { fetch } from 'isomorphic-fetch-ponyfill'"},{"note":"Exported as a named module member. TypeScript types are included for Request, Response, and Headers.","wrong":"const Request = require('isomorphic-fetch-ponyfill').Request","symbol":"Request","correct":"import { Request } from 'isomorphic-fetch-ponyfill'"},{"note":"Named export; do not use default import.","wrong":"import Headers from 'isomorphic-fetch-ponyfill'","symbol":"Headers","correct":"import { Headers } from 'isomorphic-fetch-ponyfill'"}],"quickstart":{"code":"import { fetch } from 'isomorphic-fetch-ponyfill';\n\nasync function main() {\n  const response = await fetch('https://api.example.com/data', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({ key: 'value' })\n  });\n  const data = await response.json();\n  console.log(data);\n}\nmain().catch(console.error);","lang":"typescript","description":"Demonstrates using named import and making a POST request with the ponyfill fetch."},"warnings":[{"fix":"Always use the imported fetch function explicitly; do not rely on a global fetch.","message":"Ponyfill does not polyfill global fetch; you must import and use the function explicitly. If you use it in a module that also uses global fetch (like newer Node versions), they may conflict.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Verify that your use case (e.g., streaming) works; fall back to native fetch if needed.","message":"The package is designed for Cloudflare Workers but may not support all fetch features (e.g., AbortController or stream responses) in older versions. Test thoroughly in your target environment.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.3.18':19 'across':10 'activ':82 'api':30,108 'avoid':67,99 'browser':12 'cadenc':73 'cloudflar':16,56 'command':106 'cross':60 'cross-fetch':59 'depend':25,71 'design':31 'develop':83 'discord':103 'effect':101 'environ':45 'explicit':97 'fetch':3,6,29,48,61,94 'framework':107 'global':39,93 'implement':26 'import':98 'includ':86 'indic':89 'interact':104 'isol':42 'isomorph':2 'isomorphic-fetch-ponyfil':1 'javascript':102 'like':55 'low':75 'make':49 'name':85 'nativ':14,47 'no-depend':23 'node':69 'node-specif':68 'node.js':11 'packag':77 'pollut':38 'ponyfil':4,7,35,87 'proper':34 'provid':20 'react':13 'releas':72 'replac':91 'runtim':54 'sandbox':53 'side':100 'simpl':22 'slash':105 'specif':70 'stabl':79 'suitabl':51 'typescript':110 'unlik':58 'version':18 'work':9,63 'worker':17,57,65 'wrapper':109","created_at":"2026-06-07T16:55:24.676684+00:00","updated_at":"2026-06-07T16:55:24.676684+00:00","problems":[{"fix":"Run 'npm install isomorphic-fetch-ponyfill' and ensure the import statement is correct.","cause":"Package not installed or incorrect import path.","error":"Cannot find module 'isomorphic-fetch-ponyfill'"},{"fix":"Use 'import { fetch } from 'isomorphic-fetch-ponyfill'' instead of 'import fetch from ...'. If using CommonJS: 'const { fetch } = require(...)'.","cause":"Using default import instead of named import.","error":"TypeError: fetch is not a function"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"isomorphic-fetch-ponyfill","openapi_spec":null,"status_page":null,"smithery":null,"categories":["networking"],"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}}