Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metro has encountered an error while trying to resolve module 'react-native' #143

Closed
JoshK2 opened this issue Jun 4, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@JoshK2
Copy link
Member

JoshK2 commented Jun 4, 2020

Describe the bug

This error is coming after exporting RN components and restarting the simulator when .bit folder is in the root of the project.
image

We can solve this issue by adding a Regex to the default blacklist in metro.config.js file that will ignore .bit folder:

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */
const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
  transformer: {
    getTransformOptions: async () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false,
      },
    }),
  },
  resolver: {
    blacklistRE: blacklist([/.bit\/.*/]),
  },
};

Specifications

  • Bit version: 14.7.6
  • Node version: 12.7.0
  • Platform: macOS
  • Compiler (include version): react-native@1.0.16
@JoshK2 JoshK2 self-assigned this Jun 4, 2020
@JoshK2
Copy link
Member Author

JoshK2 commented Jun 4, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant