When i start my application the build is sucessful but it throws an error:
BUILD SUCCESSFUL in 1m 6s
358 actionable tasks: 16 executed, 342 up-to-date
info Connecting to the development server...
info Starting the app on "2aab65e4393f7ece"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example/.MainActivity }
BUNDLE ./index.js
error: Error: Unable to resolve module @babel/runtime/helpers/interopRequireDefault from /Path/to/project/index.js: @babel/runtime/helpers/interopRequireDefault could not be found within the project or in these directories:
node_modules
1 | /*
| ^
2 | @format
3 | */
4 |
Reproducible demo
My Package file (can't reproduce on another project)
by logging exact console.log in the catch section from the /node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:
console:
FailedToResolveNameError: Module does not exist in the Haste module map or in these directories:
/Users/myusername/Public/react-native/ProjectName-app/node_modules
/Users/myusername/Public/react-native/node_modules
/Users/myusername/Public/node_modules
/Users/myusername/node_modules
/Users/node_modules
/node_modules
at Object.resolve (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro-resolver/src/resolve.js:122:9)
at ModuleResolver.resolveDependency (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:73:31)
at DependencyGraph.resolveDependency (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
at /Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/lib/transformHelpers.js:156:21
at resolveDependencies (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/DeltaBundler/buildSubgraph.js:42:25)
at visit (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/DeltaBundler/buildSubgraph.js:83:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async buildSubgraph (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/DeltaBundler/buildSubgraph.js:103:3)
at async Graph._buildDelta (/Users/myusername/Public/react-native/ProjectName-app/node_modules/metro/src/DeltaBundler/Graph.js:157:22) {
dirPaths: [
'/Users/myusername/Public/react-native/ProjectName-app/node_modules',
'/Users/myusername/Public/react-native/node_modules',
'/Users/myusername/Public/node_modules',
'/Users/myusername/node_modules',
'/Users/node_modules',
'/node_modules'
],
extraPaths: []
Environment
Things I’ve done to figure out my issue
Upgrading version
From: 0.72.3. => To: 0.73.6
Description
When i start my application the build is sucessful but it throws an error: BUILD SUCCESSFUL in 1m 6s 358 actionable tasks: 16 executed, 342 up-to-date info Connecting to the development server... info Starting the app on "2aab65e4393f7ece"... Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example/.MainActivity } BUNDLE ./index.js
error: Error: Unable to resolve module @babel/runtime/helpers/interopRequireDefault from /Path/to/project/index.js: @babel/runtime/helpers/interopRequireDefault could not be found within the project or in these directories: node_modules
Reproducible demo
My Package file (can't reproduce on another project)
babel.config.js
by logging exact console.log in the catch section from the /node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:
console: