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

TypeError: Cannot read property 'restart' of null #249

Open
kbqdev opened this issue Sep 10, 2023 · 6 comments
Open

TypeError: Cannot read property 'restart' of null #249

kbqdev opened this issue Sep 10, 2023 · 6 comments

Comments

@kbqdev
Copy link

kbqdev commented Sep 10, 2023

React native : 0.72.4
react-native-restart: 0.0.27

WARN Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'restart' of null
TypeError: Cannot read property 'restart' of null

@spideyinf
Copy link

I do have the same issue, Has anyone with any solution helped?

@bviebahn
Copy link

I also had this issue earlier, but after restarting the bundler and rebuilding the app it went away.

@master12
Copy link

Have the same issue. Rebuilding the bundle did not help.

@bilalaurangzebkhan
Copy link

Make sure rebuilding your app after installing react-native-restart It will not work in Expo Go

You can create a development build which is like a custom version of Expo Go. It won't work in Expo Go, because it includes native code, and that native code is not built into Expo Go. (And can't be added later.) So you need to build your app. e.g.:

eas build -p android --profile development

Then install that on your device/emulator and use it instead of Expo Go.

@ansmlc
Copy link

ansmlc commented Apr 16, 2024

Make sure rebuilding your app after installing react-native-restart It will not work in Expo Go

You can create a development build which is like a custom version of Expo Go. It won't work in Expo Go, because it includes native code, and that native code is not built into Expo Go. (And can't be added later.) So you need to build your app. e.g.:

eas build -p android --profile development

Then install that on your device/emulator and use it instead of Expo Go.

Thanks @bilalaurangzebkhan. This explanation should be in README..
Does this mean if we install it via npm / yarn add react-native-restart, create a dev-build, that's it? No need for any of that linking stuff?

@bilalaurangzebkhan
Copy link

Make sure rebuilding your app after installing react-native-restart It will not work in Expo Go
You can create a development build which is like a custom version of Expo Go. It won't work in Expo Go, because it includes native code, and that native code is not built into Expo Go. (And can't be added later.) So you need to build your app. e.g.:
eas build -p android --profile development
Then install that on your device/emulator and use it instead of Expo Go.

Thanks @bilalaurangzebkhan. This explanation should be in README.. Does this mean if we install it via npm / yarn add react-native-restart, create a dev-build, that's it? No need for any of that linking stuff?

Yes @ansmlc the newer version does auto-linking. and the react-native-restart will not work on expo Go but will work fine for development and production build.

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

No branches or pull requests

6 participants