question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Presence of local-cli __fixtures__ file breaks react-native-vector-icons

See original GitHub issue

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 6.9.2 Yarn: Not Found npm: 5.6.0 Watchman: 4.7.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.52.0 => 0.52.0

Steps to Reproduce

  1. Install https://github.com/oblador/react-native-vector-icons
  2. Use in a component
  3. Start app

Expected Behavior

App starts successfully

Actual Behavior

Error is shown:

error: bundling failed: Error: While resolving module `react-native-vector-icons/MaterialIcons`, the Haste package `react-native-vector-icons` was found. However the module `MaterialIcons` could not be found within the package. Indeed, none of these files exist:

* `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`

Steps to fix

As per https://github.com/oblador/react-native-vector-icons/issues/626

rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json

It looks like this file is outdated for some time, I’m not sure if it needs to be there but it should either be updated or removed. For some reason it refers directly to the react-native-vector-icons project.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:62
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

16reactions
vovkasmcommented, Jan 16, 2018

Workaround: addition of rn-cli.config.js (for RN 0.52 at least):

const blacklist = require('metro/src/blacklist')
module.exports = {
  getBlacklistRE () {
    return blacklist([/react-native\/local-cli\/core\/__fixtures__.*/])
  },
}

It seems some blacklist items were lost in the process of moving from RN to metro 😕

2reactions
vovkasmcommented, Jan 16, 2018

@afilp rn-cli.config.js should be located in the root directory of the project. It is location where RN will find it automatically (https://github.com/facebook/react-native/issues/7271). Seems this info not documented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native v0.54.0-rc.4 Release - GitClear
A framework for building native applications using React ... Presence of local-cli __fixtures__ file breaks react-native-vector-icons.
Read more >
react native vector icons won't show in android device
Icon shows normal but what I want is integrating react native with my existing android app, not a totally RN app. use jsbundle...
Read more >
Codebase Overview - React
This section will give you an overview of the React codebase organization, ... fixtures contains a few small React test applications for contributors....
Read more >
Icons · React Native Paper - Open Source
Configuring icons. Many of the components require the react-native-vector-icons library to render correctly. If you're using Expo, you don't need to do ...
Read more >
Add Notification Badges to Icons in React Native - PubNub
To style the UI, create a file in src/Styles called Styles.js, and add the following code. const AppStyles = { colors: { accentColor:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found