{"id":47580,"library":"fetch-detector","title":"fetch-detector","description":"Detects incomplete Fetch API support (e.g., Chrome <46, Firefox <39 where response text encoding is broken) and disables native fetch, falling back to XHR polyfills. v1.0.1 – last release dated 2016. Minimal, zero-dependency bundler-friendly utility; must be used with fetch-ie8 (imported before it). Differentiates from generic fetch polyfills by conditionally enabling native fetch only on fully compliant browsers, preventing silent data corruption due to Chinese character encoding bugs.","status":"deprecated","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/camsong/fetch-detector","tags":["javascript","fetch","github fetch","ajax"],"install":[{"cmd":"npm install fetch-detector","lang":"bash","label":"npm"},{"cmd":"yarn add fetch-detector","lang":"bash","label":"yarn"},{"cmd":"pnpm add fetch-detector","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a side-effect-only module. It must be imported before fetch-ie8, and does not export anything. Do not use default or named imports.","wrong":"import fetchDetector from 'fetch-detector'","symbol":"fetch-detector","correct":"import 'fetch-detector'"}],"quickstart":{"code":"// Install: npm install fetch-detector fetch-ie8\nimport 'fetch-detector'\nimport 'fetch-ie8'\n\n// Then use fetch normally – it will use native fetch on Chrome >=46 and Firefox >=39, otherwise XHR\nfetch('https://api.example.com/data')\n  .then(response => response.json())\n  .then(data => console.log(data))\n  .catch(err => console.error(err))","lang":"javascript","description":"Shows the correct import order: first fetch-detector, then fetch-ie8, to conditionally enable native fetch or fallback to XHR polyfill."},"warnings":[{"fix":"Consider using a modern fetch polyfill like 'whatwg-fetch' or rely on browser built-in fetch (now widely supported).","message":"Package is unmaintained since 2016. It only handles Chrome/Firefox bugs from 2015 and does not address modern browser quirks.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always place 'fetch-detector' import before 'fetch-ie8' import.","message":"Must be imported before fetch-ie8. Reversing the order will cause the detector to not work correctly.","severity":"gotcha","affected_versions":"*"},{"fix":"Create a custom declaration file: declare module 'fetch-detector';","message":"Does not ship TypeScript type definitions; using in a TS project may require a declaration file.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'2016':33 '39':13 '46':11 'ajax':81 'api':7 'back':25 'broken':19 'browser':66 'bug':76 'bundler':39 'bundler-friend':38 'charact':74 'chines':73 'chrome':10 'compliant':65 'condit':58 'corrupt':70 'data':69 'date':32 'depend':37 'detect':4 'detector':3 'differenti':52 'disabl':21 'due':71 'e.g':9 'enabl':59 'encod':17,75 'fall':24 'fetch':2,6,23,47,55,61,78,80 'fetch-detector':1 'fetch-ie8':46 'firefox':12 'friend':40 'fulli':64 'generic':54 'github':79 'ie8':48 'import':49 'incomplet':5 'javascript':77 'last':30 'minim':34 'must':42 'nativ':22,60 'polyfil':28,56 'prevent':67 'releas':31 'respons':15 'silent':68 'support':8 'text':16 'use':44 'util':41 'v1.0.1':29 'xhr':27 'zero':36 'zero-depend':35","created_at":"2026-06-07T16:52:15.063159+00:00","updated_at":"2026-06-07T16:52:15.063159+00:00","problems":[{"fix":"Ensure 'fetch-detector' is imported before 'fetch-ie8' and that both are included in your bundle.","cause":"Native fetch used on a browser with broken encoding (e.g., Chrome 45) because fetch-detector was not imported or was imported after the polyfill.","error":"Uncaught TypeError: Failed to fetch"},{"fix":"Run 'npm install fetch-detector' and verify import is 'import \"fetch-detector\"' (not from a subpath).","cause":"Missing npm install of fetch-detector or incorrect import path.","error":"Cannot find module 'fetch-detector'"}],"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/camsong/fetch-detector#readme","github":"https://github.com/camsong/fetch-detector","docs":null,"changelog":null,"pypi":null,"npm":"fetch-detector","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}}