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

Throw an error if the native module is null with steps to help fix the issue #33

Merged
merged 1 commit into from Mar 22, 2019

Conversation

matt-oakes
Copy link
Collaborator

Overview

Shows a helpful error message if linking has not been done correctly and the native module is null. It gives the steps that are most likely to fix the issue.

Before:

image

After:

image

This will help to diagnose linking issues like #30.

Test Plan

Delete RNCNetInfo.a from the "Linked Frameworks and Libraries" section and see the new error message.

@matt-oakes matt-oakes requested a review from Salakar March 22, 2019 02:14
@matt-oakes matt-oakes merged commit d3882c1 into master Mar 22, 2019
@matt-oakes matt-oakes deleted the @matt-oakes/native-module-null-warning branch March 22, 2019 15:00
react-native-community-bot pushed a commit that referenced this pull request Mar 22, 2019
# [1.4.0](v1.3.0...v1.4.0) (2019-03-22)

### Features

* Throw an error if the native module is null with steps to help fix the issue ([#33](#33)) ([d3882c1](d3882c1))
@react-native-community-bot
Copy link
Collaborator

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@viktorlarsson
Copy link

Had some issues with the CI environment failing with the following issue:

@react-native-community/netinfo: NativeModule.RNCNetInfo is null. To fix this issue try these steps:

Missed that you need to mock netinfo (if someone elses sees this)

jest.mock('@react-native-community/netinfo', () => ({
  getConnectionInfo: jest.fn()
}));

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

Successfully merging this pull request may close these issues.

None yet

4 participants