Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
121 views
in Technique[技术] by (71.8m points)

android studio - How to resolve unique error when running React Native app?

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 ComponentslayoutCustomHeader.js: None of these files exist:

  • native-base-themecomponentsHeader(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • native-base-themecomponentsHeaderindex(.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:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrc ode-hasteDependencyGraphModuleResolution.js:163:15) at ResolutionRequest.resolveDependency (C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrc ode-hasteDependencyGraphResolutionRequest.js:52:18) at DependencyGraph.resolveDependency (C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrc ode-hasteDependencyGraph.js:287:16) at Object.resolve (C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrclibransformHelpers.js:267:42)
    at C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrcDeltaBundlerraverseDependencies.js:434:31
    at Array.map () at resolveDependencies (C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrcDeltaBundlerraverseDependencies.js:431:18) at C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrcDeltaBundlerraverseDependencies.js:275:33
    at Generator.next () at asyncGeneratorStep (C:UsersshixiOneDriveDesktopVS_code_filesNYUnitysrcmobileNYUnity ode_modulesmetrosrcDeltaBundlerraverseDependencies.js:87:24)*
question from:https://stackoverflow.com/questions/65603020/how-to-resolve-unique-error-when-running-react-native-app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...