I am getting the following error when I'm trying to import the module into my React Native Project:
error: Error: While trying to resolve modulereact-native-switch-with-iconsfrom fileC:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\components\MenuCategoryPage\MenuCategory.js, the packageC:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\react-native-switch-with-icons\package.jsonwas successfully found. However, this package itself specifies amainmodule field that could not be resolved (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\react-native-switch-with-icons\index.js`. Indeed, none of these files exist:
C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\react-native-switch-with-icons\index.js\index(.native|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
at DependencyGraph.resolveDependency (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\node-haste\DependencyGraph.js:277:17)
at Object.resolve (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\lib\transformHelpers.js:170:21)
at resolveDependencies (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\DeltaBundler\graphOperations.js:466:33)
at processModule (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\DeltaBundler\graphOperations.js:232:31)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async traverseDependenciesForSingleFile (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\DeltaBundler\graphOperations.js:221:3)
at async traverseDependencies (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\DeltaBundler\graphOperations.js:147:7)
at async DeltaCalculator._getChangedDependencies (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\DeltaBundler\DeltaCalculator.js:263:42)
at async DeltaCalculator.getDelta (C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\metro\src\DeltaBundler\DeltaCalculator.js:90:16)`
I am getting the following error when I'm trying to import the module into my React Native Project:
error: Error: While trying to resolve module
react-native-switch-with-iconsfrom file
C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\components\MenuCategoryPage\MenuCategory.js, the package
C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\react-native-switch-with-icons\package.jsonwas successfully found. However, this package itself specifies a
mainmodule field that could not be resolved (
C:\HashedIn\Relay\Hashedin-Relay\AR_Food_Menu\Frontend\node_modules\react-native-switch-with-icons\index.js`. Indeed, none of these files exist: