-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
Environment
- react-native: 0.71.0
- ofetch: 1.1.0
Reproduction
- Start a react-native project
yarn add [email protected]- Add a request:
ofetch('www.example.com') - Notice the bug
Describe the bug
I just tried this on react-native (after unjs/ofetch#206) and it looks like it does not work because of node:http:
node:http could not be found within the project or in these directories
Additional context
No response
Logs
error: Error: Unable to resolve module node:http from /homer/user/project/node_modules/ofetch/dist/node.cjs: node:http could not be found within the project or in these directories:
node_modules
../../node_modules
1 | 'use strict';
2 |
> 3 | const http = require('node:http');
| ^
4 | const https = require('node:https');
5 | const nodeFetch = require('node-fetch-native');
6 | const fetch$1 = require('./shared/ofetch.0fda5c9e.cjs');
at ModuleResolver.resolveDependency (/homer/user/project/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:162:15)
at DependencyGraph.resolveDependency (/homer/user/project/node_modules/metro/src/node-haste/DependencyGraph.js:260:43)
at Object.resolve (/homer/user/project/node_modules/metro/src/lib/transformHelpers.js:177:21)
at Graph._resolveDependencies (/homer/user/project/node_modules/metro/src/DeltaBundler/Graph.js:432:35)
at Graph._processModule (/homer/user/project/node_modules/metro/src/DeltaBundler/Graph.js:218:38)
at async Graph._addDependency (/homer/user/project/node_modules/metro/src/DeltaBundler/Graph.js:314:20)
at async Promise.all (index 0)
at async Graph._processModule (/homer/user/project/node_modules/metro/src/DeltaBundler/Graph.js:263:5)
at async Graph._traverseDependenciesForSingleFile (/homer/user/project/node_modules/metro/src/DeltaBundler/Graph.js:207:5)
at async Graph.traverseDependencies (/homer/user/project/node_modules/metro/src/DeltaBundler/Graph.js:147:9)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
