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)

Most upvoted comments

npm i --save-exact native-base@2.13.8 Expo 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.js and 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/Fontisto from node_modules/native-base/dist/src/basic/IconNB.js (file to edit): @expo/vector-icons/Fontisto could not be found within the project.

Cons:

  1. You might have to edit this file at every npm install.
  2. You might not be able to use this module, IconNB.js

Screen Shot 2020-03-23 at 14 55 37

Same here, using a tab example app generated by expo and latest version of React Native.

I managed to solve it with the following steps:

  • npm uninstall react-native --save
  • Delete node_modules folder
  • npm i react-native@2.13.8 --save
  • npm i

Restart 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” _

So, importing without existence will cause an error

_ 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;

Screenshot (95) Screenshot (96)

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

npm i --save-exact native-base@2.13.8 Expo should release a version with that version

Worked for me

npm i --save-exact native-base@2.13.8 Expo should release a version with that version

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.14

yarn add @expo/vector-icons@10.1.0
or
npm i @expo/vector-icons@10.1.0

we added this font in @expo/vector-icons@10.1.0 - install it and you will have it now! it’s also listed on https://github.com/expo/vector-icons/issues/112#issuecomment-602106766

OK, 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.

Same here, using a tab example app generated by expo and latest version of React Native.

I managed to solve it with the following steps:

  • npm uninstall react-native --save
  • Delete node_modules folder
  • npm i react-native@2.13.8 --save
  • npm i

Restart Android emulator, restart expo (npm start), and it works! Thanks @onurcskun!

Apparently, there is no more react-native@2.13.8:

npm i react-native@2.13.8 --save No matching version found for react-native@2.13.8

I 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-all but the issue is still persisting. I am using Expo SDK 36

@juandav try rm -rf node_modules && npm i

@onurcskun, it is not working on the web:

expo start --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