Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

React Lifecycle functions are not called in their respective order #28

Closed
jnrepo opened this issue Dec 27, 2017 · 2 comments
Closed

React Lifecycle functions are not called in their respective order #28

jnrepo opened this issue Dec 27, 2017 · 2 comments

Comments

@jnrepo
Copy link

jnrepo commented Dec 27, 2017

I'm running into a weird issue where componentWillUnmount and render react-lifecycle function will get called before componentWillMount and cause a lot of undefined errors. Interestingly enough this only happens on release mode for iOS.

TypeError: undefined is not an object (evaluating 'this._subscribableSubscriptions.forEach')

This error is located at:
    in Navigator
    in RCTView
    in t
    in Connect(t)
    in t
    in n
    in t
    in RCTView
    in RCTView
    in t

Suddenly started happening, I'm not quite sure why.

react-native: 0.51.0
react-native-custom-components: latest-commit (not published yet)

@shan-ge
Copy link

shan-ge commented Jan 10, 2018

I got similar case, happened on release mode for iOS:

  • react: 16.0.0-beta.5
  • react-native: 0.49.3
2018-01-10 09:46:37.733 [error][tid:com.facebook.react.JavaScript] { [TypeError: undefined is not an object (evaluating 'i.View.propTypes.style')]
line: 599,
column: 4579,
sourceURL: '/var/containers/Bundle/Application/8A1A88CA-8D2D-4BE3-9729-777D36EFD1A9/EvaApp.app/main.jsbundle' }
2018-01-10 09:46:37.738607+0800 EvaApp[7627:820330] { [TypeError: undefined is not an object (evaluating 'i.View.propTypes.style')]
line: 599,
column: 4579,
sourceURL: '/var/containers/Bundle/Application/8A1A88CA-8D2D-4BE3-9729-777D36EFD1A9/EvaApp.app/main.jsbundle' }
2018-01-10 09:46:37.744 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

This error is located at:
in RCTView
in a
in a
in RCTView
in RCTView
in RCTView
in Navigator
in RCTView
in t
in RCTView
in RCTView
in t
2018-01-10 09:46:37.743753+0800 EvaApp[7627:820330] Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

This error is located at:
in RCTView
in a
in a
in RCTView
in RCTView
in RCTView
in Navigator
in RCTView
in t
in RCTView
in RCTView
in t
2018-01-10 09:46:37.748 [error][tid:com.facebook.react.JavaScript] { [Invariant Violation: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

@jnrepo
Copy link
Author

jnrepo commented Jan 10, 2018

@ruinangel

after some digging this was the cause facebook/react-native#17348 (comment)

The issue was with one of the newer version of uglify-es. If you upgrade to the latest React Native the dependency was updated so it should work, but for whatever reason you want to stay on your version you can do npm install -save [email protected] which will pin the working dependency into your module.

Make sure the dependency is uglify-es: "3.2.2" and not uglify-es: "^3.2.2" in your package.json.

Since this isn't an issue of this component, going to close this one out.

@jnrepo jnrepo closed this as completed Jan 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants