NativeBase: error on nativebase 2.13.12 and expo 36.0.0 (REACT-NATIVE)
Unable to resolve “@expo/vector-icons/Fontisto” from “node_modules/native-base/dist/src/basic/IconNB.js”
EDIT Downgrading 2.13.8 is an alternative solution:
npm i --save-exact native-base@2.13.8
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 44
- Comments: 44 (8 by maintainers)
npm i --save-exact native-base@2.13.8Expo should release a version with that version@juandav try rm -rf node_modules && npm i
@DavidCorral94 @lmisael you should install native-base 2.13.8 not react native 😃
This solution everyone is mentioning to downgrade, isn’t a real solution. We need to reverse this commit: https://github.com/GeekyAnts/NativeBase/pull/3091 or we need to understand what other dependencies need updating.
There are bug fixes since 2.13.8 that people need.
Downgraded from @2.13.12 to @2.13.8 and it works fine. For yarn projects, use
yarn add native-base@2.13.8
I had to edit
IconNB.jsand block comment on the importation of the icons from this module.NB: The error I was getting and note also it is a temporary fix:
bundling failed: Error: Unable to resolve module
@expo/vector-icons/Fontistofromnode_modules/native-base/dist/src/basic/IconNB.js(file to edit): @expo/vector-icons/Fontisto could not be found within the project.Cons:
npm install.Same here, using a tab example app generated by
expoand latest version ofReact Native.I managed to solve it with the following steps:
npm uninstall react-native --savenode_modulesfoldernpm i react-native@2.13.8 --savenpm iRestart Android emulator, restart
expo(npm start), and it works! Thanks @onurcskun!Any update on a solution to the newer version? Proceeding with a downgrade to fix this. Docs should be updated with how long this issue has been open. Spent 3 days trying to figure out what was wrong when trying to install the library for the first time. Doesn’t leave a good first impression.
Actually, Fontisto is not included in @expo/vector-icons in “@expo/vector-icons”: “^10.0.6” . You can see it in "node_modules/@expo/vector-icons/build " directory ,there is no ‘Fontisto.js’ named file . But it is required in “node_modules/native-base/dist/src/basic/IconNB.js” _
_ SOLUTION 1. (worked for me) 👍 dependencies { “@expo/vector-icons”: “^10.0.6”, “native-base”: “^2.13.12”, “expo”: “^36.0.2”, “expo-font”: “^8.1.0”, } Refactor the code or search for ‘_Fontisto’ in “node_modules/native-base/dist/src/basic/IconNB.js” and comment the lines as shown in figure Following three lines are of no use and it needs to be commented //var _Fontisto = require(‘react-native-vector-icons/Fontisto’); //var _Fontisto2 = _interopRequireDefault(_Fontisto); //case ‘Fontisto’: this.Icon = _Fontisto2.default; break;
Though the paths in IconNB.js requires “react-native-vector-icons” but it is taking “expo/vector-icons” . This type of behaviour is shown when you use
‘native-base’ and ‘react-native’ together
‘expo/vector-icons’ and ‘react-native-vector-icons’ together
Worked for me
It’s work for me, thank
Same issue here
Installing this dependency solved my problem I’m using it
expo 39.0.0,native-base 2.13.14OK, let’s wait…
yarn add native-base@2.13.8
Work for me tks
@onurcskun wow, that’s right! Thanks. I’ve just copied the previous code and didn’t notice that.
Apparently, there is no more react-native@2.13.8:
npm i react-native@2.13.8 --saveNo matching version found for react-native@2.13.8I can confirm this too.
I am also facing this issues. Downgraded the nativebase version as adivised by @onurcskun , removed node_modules and ran
watchmen watch-de-allbut the issue is still persisting. I am using Expo SDK 36@onurcskun, it is not working on the web:
but, if you install react-native-web@0.11.7, this works. require native-base@2.13.8
I did not find a solution for 2.13.12 but just downgraded version to 2.13.8 and its fine