"native-base": "^2.4.0",
"react": "16.2.0",
"react-native": "0.53.3",
expected to work
npm install on my project, react-native link and then run the project to see this error..
App throws a red screen with the error
error: bundling failed: Error: Unable to resolve module `./theme/components` from `/Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/index.js`: The module `./theme/components` could not be found from `/Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/index.js`. Indeed, none of these files exist:
* `/Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/theme/components(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
* `/Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/theme/components/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
at ModuleResolver.resolveDependency (/Users/bhakta/dev/react-native/astro/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:311:1122)
at ResolutionRequest.resolveDependency (/Users/bhakta/dev/react-native/astro/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:96:16)
+ [email protected]
updated 1 package in 7.48s
bhakta@Bhaktas-MacBook-Pro:~/dev/react-native/astro$
bhakta@Bhaktas-MacBook-Pro:~/dev/react-native/astro$
bhakta@Bhaktas-MacBook-Pro:~/dev/react-native/astro$ cd node_modules/native-base/src
bhakta@Bhaktas-MacBook-Pro:~/dev/react-native/astro/node_modules/native-base/src$ ll
total 16
-rw-r--r-- 1 bhakta staff 221 Mar 27 11:41 init.js
-rw-r--r-- 1 bhakta staff 3273 Mar 27 11:41 index.js
drwxr-xr-x 56 bhakta staff 1792 Mar 27 12:33 basic
drwxr-xr-x 3 bhakta staff 96 Mar 27 12:33 theme
drwxr-xr-x 6 bhakta staff 192 Mar 27 12:33 Utils
bhakta@Bhaktas-MacBook-Pro:~/dev/react-native/astro/node_modules/native-base/src$ head index.js
import { StyleProvider, connectStyle } from "native-base-shoutem-theme";
import { keys } from "lodash";
import { Col, Row, Grid } from "react-native-easy-grid";
// import { Gravatar } from "./basic/Gravatar";
import setDefaultThemeStyle from "./init";
import getTheme from "./theme/components";
import variables from "./theme/variables/platform";
import Drawer from "./basic/Drawer";
import { SwipeRow } from "./basic/SwipeRow";
import { Text } from "./basic/Text";
bhakta@Bhaktas-MacBook-Pro:~/dev/react-native/astro/node_modules/native-base/src$ ls ./theme/
variables
I don't see components?
error: bundling failed: Error: Unable to resolve module ./theme/components from /Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/index.js: The module ./theme/components could not be found from /Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/index.js. Indeed, none of these files exist:
/Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/theme/components(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)/Users/bhakta/dev/react-native/astro/node_modules/native-base/dist/src/theme/components/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)@bhakta0007 Yes, we are looking into it
theme/components is missing
though it is present in repo on branch master
i worked around for now, by manually copying the components folder for master to my node_modules/native-base/....
https://github.com/GeekyAnts/NativeBase/releases/tag/v2.4.1-0
Use this till we fix the issue
"native-base": "~2.3.0",
"prop-types": "^15.6.1",
"react": "16.3.0-alpha.1",
"react-native": "0.51.0",
I fixed it by navigating to react-base-theme/ then sudo chmod 755 -R *
Most helpful comment
Fixed with https://github.com/GeekyAnts/NativeBase/releases/tag/v2.4.1