{"id":18201,"library":"cerebral-http-bugfix-1210","title":"@cerebral/http (HTTP Provider for Cerebral 2)","description":"HTTP provider for Cerebral 2 (cerebral ^4.0.1), current version 4.0.2. Stable but unmaintained since 2020; the Cerebral ecosystem moved to v5/v6 with breaking changes. Provides factories (httpGet, httpPost, etc.) for use in signals and actions, supporting CORS, file uploads, progress, and abort. Exposes HttpProviderError for error handling. Last updated 2020; recommend migrating to cerebral v6 for continued support.","status":"deprecated","version":"4.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/cerebral/cerebral","tags":["javascript","cerebral","http","typescript"],"install":[{"cmd":"npm install cerebral-http-bugfix-1210","lang":"bash","label":"npm"},{"cmd":"yarn add cerebral-http-bugfix-1210","lang":"bash","label":"yarn"},{"cmd":"pnpm add cerebral-http-bugfix-1210","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; requires cerebral ^4.0.1 (not compatible with cerebral v5/v6)","package":"cerebral","optional":false}],"imports":[{"note":"Default export; CJS require may work but is not recommended.","wrong":"const HttpProvider = require('@cerebral/http')","symbol":"HttpProvider","correct":"import HttpProvider from '@cerebral/http'"},{"note":"Operator factories are in '@cerebral/http/operators', not the main module.","wrong":"import { httpGet } from '@cerebral/http'","symbol":"httpGet, httpPost, httpPut, httpDelete, httpPatch","correct":"import { httpGet } from '@cerebral/http/operators'"},{"note":"Named export, not default.","wrong":"import HttpProviderError from '@cerebral/http'","symbol":"HttpProviderError","correct":"import { HttpProviderError } from '@cerebral/http'"}],"quickstart":{"code":"import { Controller, Module } from 'cerebral';\nimport HttpProvider from '@cerebral/http';\n\nconst http = HttpProvider({\n  baseUrl: 'https://api.example.com',\n  headers: { 'Content-Type': 'application/json' },\n  withCredentials: false,\n});\n\nconst app = Module({\n  providers: { http },\n  state: { items: [] },\n  signals: {\n    fetchItems: [\n      function getItems({ http, state }) {\n        return http.get('/items')\n          .then(response => ({ result: response.result }));\n      },\n      ({ state, props }) => { state.set('items', props.result); },\n    ],\n  },\n});\n\nconst controller = Controller(app);\n// Use with UI framework (React etc.)","lang":"typescript","description":"Shows setup of HttpProvider with baseUrl, a signal that does a GET request, and updates state."},"warnings":[{"fix":"Use @cerebral/http from cerebral v5+ or migrate to cerebral v6's built-in HTTP provider.","message":"Not compatible with cerebral v5/v6; only works with cerebral ^4.0.1.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Consider using the official cerebral v6 HTTP provider or a custom fetch-based solution.","message":"Package last released in 2020; no longer maintained.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use `import { httpGet } from '@cerebral/http/operators'`.","message":"Operator factories (httpGet, etc.) must be imported from '@cerebral/http/operators', not '@cerebral/http'.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use `import { HttpProviderError } from '@cerebral/http'`.","message":"HttpProviderError is a named export, not default; importing as default will break.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure your bundler supports package.json exports or import directly from '@cerebral/http' (main module) and use actions instead.","cause":"The package does not ship operators in the main entry; some bundlers may resolve incorrectly.","error":"Cannot find module '@cerebral/http/operators'"},{"fix":"Add `providers: { http: HttpProvider({...}) }` in your Module definition.","cause":"HttpProvider not added to controller's providers array.","error":"TypeError: http.get is not a function"},{"fix":"Check CORS headers on server, enable withCredentials if needed, or verify URL.","cause":"CORS issue or network error; request failed.","error":"Uncaught (in promise) HttpProviderError: Failed to fetch"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}