{"id":47617,"library":"fetch-mock-forwarder","title":"fetch-mock-forwarder","description":"A drop-in replacement for isomorphic-fetch designed to enable fetch-mock usage in browser environments. Version 1.0.0, no release cadence defined. This package re-exports the global fetch by requiring whatwg-fetch, allowing webpack aliasing so that modules importing isomorphic-fetch will use it instead, enabling fetch-mock to intercept requests.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/spaceviewinc/fetch-mock-forwarder","tags":["javascript","fetch-mock","fetch","isomorphic-fetch"],"install":[{"cmd":"npm install fetch-mock-forwarder","lang":"bash","label":"npm"},{"cmd":"yarn add fetch-mock-forwarder","lang":"bash","label":"yarn"},{"cmd":"pnpm add fetch-mock-forwarder","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"provides the global fetch polyfill","package":"whatwg-fetch","optional":false}],"imports":[{"note":"The package does not export any symbols; it only loads whatwg-fetch and uses the global fetch.","wrong":"Direct import: import fetch from 'fetch-mock-forwarder' (does not export anything)","symbol":"(none)","correct":"Use via webpack alias: 'isomorphic-fetch' -> 'fetch-mock-forwarder'"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  resolve: {\n    alias: {\n      'isomorphic-fetch': 'fetch-mock-forwarder'\n    }\n  }\n};\n\n// test file\nimport fetchMock from 'fetch-mock';\nimport 'isomorphic-fetch'; // now uses fetch-mock-forwarder\n\nfetchMock.mock('http://example.com', 200);\nconst response = await fetch('http://example.com');\nconsole.assert(response.status === 200);","lang":"javascript","description":"Shows how to alias isomorphic-fetch to fetch-mock-forwarder in webpack and use it with fetch-mock."},"warnings":[{"fix":"Configure webpack resolve.alias for 'isomorphic-fetch' as shown in quickstart.","message":"Requires webpack alias; does not work without bundler configuration.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not attempt to import any symbol from this package.","message":"No named exports; wrapper only sets up global fetch.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure whatwg-fetch is not loaded separately to avoid double polyfill.","message":"Assumes global fetch exists after requiring whatwg-fetch; might conflict with other polyfills.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':25 'alias':45 'allow':43 'browser':22 'cadenc':28 'defin':29 'design':14 'drop':7 'drop-in':6 'enabl':16,57 'environ':23 'export':34 'fetch':2,13,18,37,42,52,59,66,68,71 'fetch-mock':17,58,65 'fetch-mock-forward':1 'forward':4 'global':36 'import':49 'instead':56 'intercept':62 'isomorph':12,51,70 'isomorphic-fetch':11,50,69 'javascript':64 'mock':3,19,60,67 'modul':48 'packag':31 're':33 're-export':32 'releas':27 'replac':9 'request':63 'requir':39 'usag':20 'use':54 'version':24 'webpack':44 'whatwg':41 'whatwg-fetch':40","created_at":"2026-06-07T16:52:26.138238+00:00","updated_at":"2026-06-07T16:52:26.138238+00:00","problems":[{"fix":"Add resolve.alias in webpack.config.js: 'isomorphic-fetch': 'fetch-mock-forwarder'","cause":"Alias not set in bundler configuration.","error":"Cannot find module 'isomorphic-fetch'"},{"fix":"Verify webpack alias and that whatwg-fetch is installed.","cause":"fetch-mock-forwarder not loaded (alias not working) or whatwg-fetch not bundled correctly.","error":"fetch is not defined"}],"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/spaceviewinc/fetch-mock-forwarder#readme","github":"git://github.com/spaceviewinc/fetch-mock-forwarder","docs":null,"changelog":null,"pypi":null,"npm":"fetch-mock-forwarder","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"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}}