Closed jimmi-joensson closed 4 years ago
I have found a solution to the issue. Using this regex /\/bit\/(?!.*dist).*/
all the non 'dist' files from my imported component are blacklisted from the project.
const blacklist = require('metro-config/src/defaults/blacklist');
// blacklist is a function that takes an array of regexes and combines
// them with the default blacklist to return a single regex.
module.exports = {
resolver: {
blacklistRE: blacklist([/\/bit\/(?!.*dist).*/])
}
};
I will let you decide if this is an acceptable solution for the issue. I think it is if the solution is added in a guide or the docs.
Best regards!
Hi @jimmi-joensson,
First, thanks for opening the issue and documenting well the problem. Thanks for your solution, I already wrote about it in another issue with another error but with the same solution, maybe the regex needs to be adjusting depending on the error we get. I also wrote about it in the compiler page in bit.dev.
I close the issue, and I'll also something about this issue in the compiler README. Thanks!
@JoshK2 You're welcome!
No problem, it was the least I could do. Its good that it is described at the compiler page. However, I think it might be a bit miss-placed there. When I was looking for a solution to my issue, I was looking first at the docs and more preciously the guides. I think it would be great to have a RN section under "Frameworks" in the submenu and include it there. It never occurred to me that the answer could be under the RN or for that matter any compiler page.
You completely right about it, I'll add soon as possible documentation about RN and about the possible issues users can have.
Describe the bug
I'm experiencing a
jest-haste-map
error after bit importing any component into a new initialised Expo Managed Workflow project. I have tried to exclude the bit directory with modulePathIgnorePatterns in jest.config.js without success.I also tried to exclude by blacklisting it in metro.config.js as suggested here.
however this resulted in the app not being able to locate the component at all.
Steps to Reproduce
expo init expo-test/
cd ./expo-test/
bit init
npm install <any-typescript-bit-component>
and implement this component in App.tsxnpm run ios
- Everything runs greatctrl+c
bit import <any-typescript-bit-component>
npm run ios
and the "jest-haste-map" error occur.bit eject <any-typescript-bit-component>
and everything works againExpected Behavior
The expectation is no
jest-haste-map
errorScreenshots, exceptions and logs
"jest-haste-map" error:
This error makes it impossible to work locally on a bit component and test it in an IOS simulator. The following errors are shown when the simulator loads:
IOS simulator error:
Console error:
Specifications
Additional context
package.json with Bit settings