Registry / http-networking / cerebral-http-bugfix-1210

cerebral-http-bugfix-1210

JSON →
library4.0.2jsnpmunverified

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.

npm install cerebral-http-bugfix-1210
INSTALL
IMPORT
SIG · CEREBRAL-HTTP-BUGF
C
cerebral-http-bugfix-1210
http-networkingjavascriptv4.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpProvider
import HttpProvider from '@cerebral/http'
const HttpProvider = require('@cerebral/http')
Default export; CJS require may work but is not recommended.
httpGet, httpPost, httpPut, httpDelete, httpPatch
import { httpGet } from '@cerebral/http/operators'
import { httpGet } from '@cerebral/http'
Operator factories are in '@cerebral/http/operators', not the main module.
HttpProviderError
import { HttpProviderError } from '@cerebral/http'
import HttpProviderError from '@cerebral/http'
Named export, not default.

Shows setup of HttpProvider with baseUrl, a signal that does a GET request, and updates state.

import { Controller, Module } from 'cerebral'; import HttpProvider from '@cerebral/http'; const http = HttpProvider({ baseUrl: 'https://api.example.com', headers: { 'Content-Type': 'application/json' }, withCredentials: false, }); const app = Module({ providers: { http }, state: { items: [] }, signals: { fetchItems: [ function getItems({ http, state }) { return http.get('/items') .then(response => ({ result: response.result })); }, ({ state, props }) => { state.set('items', props.result); }, ], }, }); const controller = Controller(app); // Use with UI framework (React etc.)
Debug
Known issues
breakingNot compatible with cerebral v5/v6; only works with cerebral ^4.0.1.
fix
Use @cerebral/http from cerebral v5+ or migrate to cerebral v6's built-in HTTP provider.
affects: >=5.0.0
deprecatedPackage last released in 2020; no longer maintained.
fix
Consider using the official cerebral v6 HTTP provider or a custom fetch-based solution.
affects: >=4.0.0
gotchaOperator factories (httpGet, etc.) must be imported from '@cerebral/http/operators', not '@cerebral/http'.
fix
Use `import { httpGet } from '@cerebral/http/operators'`.
affects: >=4.0.0
gotchaHttpProviderError is a named export, not default; importing as default will break.
fix
Use `import { HttpProviderError } from '@cerebral/http'`.
affects: >=4.0.0
Errors
Common errors & fixes
Cannot find module '@cerebral/http/operators'
The package does not ship operators in the main entry; some bundlers may resolve incorrectly.
fix
Ensure your bundler supports package.json exports or import directly from '@cerebral/http' (main module) and use actions instead.
TypeError: http.get is not a function
HttpProvider not added to controller's providers array.
fix
Add `providers: { http: HttpProvider({...}) }` in your Module definition.
Uncaught (in promise) HttpProviderError: Failed to fetch
CORS issue or network error; request failed.
fix
Check CORS headers on server, enable withCredentials if needed, or verify URL.
Upgrade
Version history
4.0.2latest on npm
Audit
Dependencies
cerebralrequiredPeer dependency; requires cerebral ^4.0.1 (not compatible with cerebral v5/v6)
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
cerebral-http-bugfix-1210 — npm install cerebral-http-bugfix-1210 · libregistry