0
votes

I am using VS code with Android studio and I am receiving an error that I don't know how to resolve. Error Picture

I found out that My error is because I imported this into my app. import headerTheme from '../../native-base-theme/components/Header';

How do I resolve this error?

This is what I am getting in my vscode terminal:

*info Reloading app... [Wed Jan 06 2021 17:34:52.340] BUNDLE ./index.js error: Error: Unable to resolve module ../../native-base-theme/components/Header from Components\layout\CustomHeader.js: None of these files exist:

  • native-base-theme\components\Header(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • native-base-theme\components\Header\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) at ModuleResolver.resolveDependency (C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:163:15) at ResolutionRequest.resolveDependency (C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18) at DependencyGraph.resolveDependency (C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\node-haste\DependencyGraph.js:287:16) at Object.resolve (C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\lib\transformHelpers.js:267:42)
    at C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\DeltaBundler\traverseDependencies.js:434:31
    at Array.map () at resolveDependencies (C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\DeltaBundler\traverseDependencies.js:431:18) at C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\DeltaBundler\traverseDependencies.js:275:33
    at Generator.next () at asyncGeneratorStep (C:\Users\shixi\OneDrive\Desktop\VS_code_files\NYUnity\src\mobile\NYUnity\node_modules\metro\src\DeltaBundler\traverseDependencies.js:87:24)*
1
There are literally thousands of questions and answers about this. Just make your research....Uğur Eren
I ran npm install native-base but the error is still there. I also tried running "npm install native-base-theme", but got an error. I updated my post with more detail about the error that I'm getting.Kevin Wu

1 Answers

0
votes

It looks like it might be looking for the files in a directory two levels above in the file tree. The error returns ../../ in the file path. Can you either move those files or update the file path to reflect where the files are?