Solution skill
Algolia v5 breaks React Native: "Unable to resolve module http"
Complete solution
Shows how to fix algolia v5 breaks React Native: "Unable to resolve module http". Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "Unable to resolve module http from node_modules/@algolia/requester-node-http/src/createHttpRequester.ts": upgrade: npm install algoliasearch@^5.5.1 (or newer 5.x). The maintainers fixed requester selection and released the fix in 5.5.1.
Unable to resolve module http from node_modules/@algolia/requester-node-http/src/createHttpRequester.tsSteps
- With
algoliasearch5.x and React Native, Metro fails with:
Unable to resolve module http from node_modules/@algolia/requester-node-http/src/createHttpRequester.ts- The Node requester imports the
http,https, andurlbuiltins, which Metro
cannot resolve. The same project worked on algoliasearch 4.23.3.
- Algoliasearch v5 bundled the Node HTTP requester in a way that resolved to
@algolia/requester-node-http on React Native. The maintainers fixed requester selection and released the fix in 5.5.1.
- Upgrade:
npm install algoliasearch@^5.5.1(or newer 5.x). Clean the stale resolver entries: delete and reinstall
node_modules, and clean theiosandandroidbuild folders (a plain upgrade without cleaning can leave the old resolution in place).- Rebuild. The reporter confirmed it works after the clean rebuild.
- If you see this same error shape ("Unable to resolve module X from
@algolia/...") on another platform, suspect the requester selection first.
A duplicate report (issue 1547) was closed as a duplicate of the original, so search before filing.
When to use
You are seeing this: The same project worked on algoliasearch 4.23.3. Use this skill when you run into "Algolia v5 breaks React Native: "Unable to resolve module http"".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: algoliasearch 4.23.3, 5.5.1. If you are on something much newer or older, the details may have shifted.
Why this happens
Algoliasearch v5 bundled the Node HTTP requester in a way that resolved to @algolia/requester-node-http on React Native.
Evidence
A user on algoliasearch 5.4.3 with React Native 0.73.6 hit "Unable to resolve module http" from @algolia/requester-node-http, because the v5 bundling resolved the Node HTTP requester (importing the http builtin) on React Native, which Metro cannot resolve. The verified resolution: the maintainers fixed requester selection in 5.5.1, so upgrade to 5.5.1 or later and clean the ios, android, and nodemodules folders; the reporter confirmed it then works. Thread: https://vectle.com/threads/thr5kttrq1o71_GHY0td8IfTA
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_BY7EK50UqB3LaFyNrFfW3A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Algolia v5 breaks React Native: "Unable to resolve module http" <span>— Vectle</span></a>