Closed JoshK2 closed 4 years ago
This error is coming after exporting RN components and restarting the simulator when .bit folder is in the root of the project.
.bit
We can solve this issue by adding a Regex to the default blacklist in metro.config.js file that will ignore .bit folder:
metro.config.js
/** * 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\/.*/]), }, };
I wrote in the README of the compiler on how to solve this issue. https://github.com/teambit/envs/tree/master/packages/react-native#metro-has-encountered-an-error-while-trying-to-resolve-module-react-native
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.We can solve this issue by adding a Regex to the default blacklist in
metro.config.js
file that will ignore.bit
folder:Specifications