Open scbrady opened 6 years ago
Is your project made using create react native app or react native's cli?
@dariocravero It was using create react native app
Also along these lines, jest cannot be run from within the native app.
@scbrady I just realised that your issue was that getConfig
doesn't have a default for the options object, sorry about that. Could you try v1.0.2? I just released a fix with default options on it.
Also, do you still need metro-bundler
? I tried the process again and didn't need to install it.
Thanks!
@bcarroll22 what errors are you seeing?
@dariocravero Thanks, I no longer have to provide the empty object now. But I do still need metro-bundler
, if I take it out, I get this error:
Error: Cannot find module 'metro-bundler/src/blacklist'
And as far as jest goes, there are a lot of errors that come up, I tried getting it to work for hours last night.
At first, you get this:
Error: Cannot find module '/Users/asdf/Documents/Code/referral/native/node_modules/jest/bin/jest.js'
But you can fix it by changing the test script:
"test": "node ../node_modules/jest/bin/jest.js"
Then you get this:
Module <rootDir>/node_modules/jest-expo/src/setup.js in the setupFiles option was not found.
And there are multiple ways to get around this, but even when you do, you end up at this error:
Cannot find module 'setupDevtools' from 'setup.js'
I couldn't get past that error reliably.
This is the best description of the problem that I found: https://github.com/facebook/react-native/issues/17469
Just seen this thread - I made an issue the other day regarding the 'metro-bundler' issue: #10
It seems like create react app installs metro-bundler into the 'metro' folder. Installing metro-bundler manually is the workaround I'm using for now
In order to get my React-Native project running, I had to do two extra things that aren't written in the readme:
yarn add --dev metro-bundler
rn-cli.config.js
Otherwise, I would get
Cannot read property 'nodeModules' of undefined
.I can sent a PR if these are legitimate issues and if they weren't specific to my use case.