Home > OS >  Unable to resolve module ./index
Unable to resolve module ./index

Time:05-17

I was running my project well but suddenly this error start to appear:

Logs for your project will appear below. Error: Unable to resolve module ./index from C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app/.: None of these files exist: * index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json) * index\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json) at ModuleResolver.resolveDependency (C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:136:15) at DependencyGraph.resolveDependency (C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app\node_modules\metro\src\node-haste\DependencyGraph.js:231:43) at C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app\node_modules\metro\src\lib\transformHelpers.js:129:24 at Server._resolveRelativePath (C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app\node_modules\metro\src\Server.js:1107:12) at Server.requestProcessor [as _processBundleRequest] (C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app\node_modules\metro\src\Server.js:450:37) at Server._processRequest (C:\Users\mateu\OneDrive\Documentos\React JS\Projetos\sleeper-app\sleeper-app-v1\sleeper-app\node_modules\metro\src\Server.js:406:9)

The weird part is that I actually have an index.js file and I did not any change in it:

all my project files

My index.js file contains this:

import 'react-native-gesture-handler'
import { registerRootComponent } from 'expo';
import TrackPlayer from 'react-native-track-player';

import App from './App';

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);

// AppRegistry.registerComponent(...);
TrackPlayer.registerPlaybackService(() => require('./service'));

I tried to reinstall all the packages, clean the node_modules, upgrade the expo, clean the gradle, reset the cache by using expo r -c, stop my onedrive, restart my computer and nothing works

CodePudding user response:

There is probably something wrong with my OneDrive. I took my app folder out of the /OneDrive folder and it worked.

  • Related