0

I often get this error when changing things in my react-native project.

17:27:35: Failed building JavaScript bundle
17:27:42: Warning: 'react' peer dependency missing. Run `npm ls` in /Users/navalsaini/hf/nativeapp to see full warning.
17:27:42: 
17:27:42: If there is an issue running your project, please run `npm install` in /Users/navalsaini/hf/nativeapp and restart.
Building JavaScript bundle [========================================================================================= ] 99

Additionally when I run an eslint, I dont get any issues. (The ones blow are not entirely related to my code and I get them anyway - even when the project works)

/Users/navalsaini/hf/nativeapp/src/platforms/native/utils/fbAuth.js
  7:33  error  'Expo' is not defined  no-undef

✖ 1 problems (1 errors, 0 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint: `eslint . --fix`

Is there a better way to configure my expo build system?

My eslintrc looks as below.

cat .eslintrc.json 
{
  "extends": "expo/native",
  "rules": {
    "react/jsx-no-bind": [false]
  }
}

This is important because it is a huge waste of my time.

1 Answer 1

2

I have realised that if I want to know the exact build error, this is what works for me.

  1. Push the currently modified code in repo to stash and go to last working commit
  2. The application runs (as we are on a working commit)
  3. Apply the stash - this triggers a rebuild while expo is running (and does not crash expo)

The build errors are dumped on simulator screen with a red background.

This does save me time as compared to tracing which change made the build break.

Sign up to request clarification or add additional context in comments.

1 Comment

your approach was genius and saved me a ton of time!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.