Cannot load FontAwesome5 or FontAwesome5Pro fonts
I'm having some issues importing react-native-vector-icons when I select FontAwesome5 or FontAwesome5Pro.
Here's how I'm importing it
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5Pro';
Here's the error message:
bundling failed: Error: Unable to resolve module react-native-vector-icons/FontAwesome5Pro from ...: Module react-native-vector-icons/FontAwesome5Pro does not exist in the Haste module map
I've tried
- npm install react-native-vector-icons
- uninstall and use yarn to reinstall
- uninstall and run npm to reinstall
- reinstall the package via npm/yarn then,
react-native start --reset-cache - Executing
./node_modules/.bin/fa5-upgradefrom project root directory to upgrade from FontAwesome to FontAwesome5Pro. It shows "No such file or directory" error
Additional notes:
-
under./node_modules/react-native-vector-icons/Fonts in my project folder, FontAwesome styled fonts (i.e. FontAwesome5_Brands.ttf) is not present.
-
under./node_modules/react-native-vector-icons/Fonts in my project folder, FontAwesome5.js and FontAwesome5Pro.js is not present
Any suggestion is appreciated.
Did you install this from npm or git? The npm version does not contain the FA5 updates 🙃
Ah ok, that explains it. I tried npm and yarn. How can I install this via git and integrate it with my react-native project?
Good to hear that we found the problem 🙂
You can choose where npm should install the package from, check out the docs here 🙂
Thanks for helping! Sorry to bump this thread, but I thought it would be related and helpful to others who may have the same problem as I do...
I used the instructions from your link to add the project using github's link. When I import and try to use FontAwesome5.getImageSource() after importing from "react-native-vector-icons/FontAwesome5" or "react-native-vector-icons/FontAwesome5Pro", I get this red screen on my iPhone.

It looks like this error message has to do with Object-C/Swift code. I'm wondering if you may know how to resolve this?
Could you share some javascript? 🙂
import FontAwesome from 'react-native-vector-icons/FontAwesome5Pro';
Promise.all([
FontAwesome.getImageSource("angle-left", 38),
FontAwesome.getImageSource("ellipsis-h", 26)])
.then(icons => {
const rightButtons = (this.options.length > 0)? [{ icon: icons[1], id: 'dots' }] : [];
const leftButtons = [{ icon: icons[0], id: 'back' }];
this.props.navigator.setButtons({
rightButtons,
leftButtons
});
});
Hmm, I can't seem to be able to reproduce the error... Can you use regular icons?
Yes. I can use FontAwesome and IonIcons without issues.
Can you include the entire callstack (should be printed to the console as well)?
Exception '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' was thrown while invoking getImageForFontAwesome5 on target RNVectorIconsManager with params (
"Font Awesome 5 Free",
"\Uf104",
38,
0,
4278190080,
12515
)
callstack: (
0 CoreFoundation 0x0000000183496da4
RCTFatal facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) _dispatch_call_block_and_release _dispatch_client_callout _dispatch_queue_serial_drain _dispatch_queue_invoke _dispatch_root_queue_drain_deferred_wlh _dispatch_workloop_worker_thread _pthread_wqthread start_wqthread
Console version:
ExceptionsManager.js:71 Exception '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' was thrown while invoking getImageForFontAwesome5 on target RNVectorIconsManager with params (
"Font Awesome 5 Free",
"\Uf104",
38,
0,
4278190080,
16165
)
callstack: (
0 CoreFoundation 0x0000000183496da4
I'm sorry, I still can't reproduce or figure out what is wrong. Can you try removing the ./node_modules/react-native-vector-icons folder, reinstalling npm install and relinking react-native link react-native-vector-icons the library? Maybe there is some remains from the old npm library that you installed.
I tried it just now, but the issue is still happening on my end. Here's what I did:
-
npm uninstall react-native-vector-icon. Verified the package was deleted from node_modules directory.
-
Added
"react-native-vector-icon": "oblador/react-native-vector-icons"to package.json under dependencies property. -
npm install
-
react-native link react-native-vector-icons.
I noticed that when I installed the package using github repo style link, index.js was not under dist directory, leading to error. I modified the package's package.json to set main property to "index.js" to get my app to load.
Hello, any chance this will be made available through Expo directly? I was able to get others running without any additional steps, but it seems FA5 would require me to eject and work directly with the native platforms? Or is it that other fonts will also require me to eject once I want to build native binaries? It would be great if those could be clarified in the README. Thanks!
Expo is not supported by this package, use https://github.com/expo/vector-icons. It doesn't require FA5 at the moment (see https://github.com/expo/vector-icons/issues/58). The other fonts seem (and should) be supported.
hi, i have a slightly different issue. i can't seem to load up FA5 Pro fonts v5.4.1 nor v5.4.2 (the latest version at this time). in the README, under Bundled Icon Sets, i noticed that the version of FA5 /FA5 Pro fonts is at v5.3.1. does this imply that newer versions won't work?
Indeed, the new icons are not included in the glyphmap. Technically the font should load fine and work whether it's 5.3 or 5.4 but the icons from 5.4 are not accessible using this framework (currently). I'll upgrade it this week 🙂
Is not working at all or just missing icons?
hi, @hampustagerud. good to know! looking forward to it and thanks for the awesome work.
the FA5 Pro fonts are working up to 5.3, while newer icons from 5.4 are showing up as ? despite updating to 5.4 .ttf files.
Then that is an upgrading problem, good to know! Stay tuned for the next release 🙂 If you want it before it is released on npm you should use the github repo in your package.json:
"react-native-vector-icons": "oblador/react-native-vector-icons"

I also faced this issue when upgrade the version from v4.6.0 to v6.6.0. And finally found this is caused the new font resource is not under my QA target. Fixed it by clicking it to my current target.