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 'bind' of undefined #22718

Closed
denchp opened this issue Dec 19, 2018 · 12 comments
Closed

TypeError: Cannot read property 'bind' of undefined #22718

denchp opened this issue Dec 19, 2018 · 12 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@denchp
Copy link

denchp commented Dec 19, 2018

Environment

React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 17.51 GB / 31.52 GB
Binaries:
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5056338

Description

Receiving the error "Type Error: Cannot read property 'bind' of undefined"

The offending line is in
react-native\Libraries\Animated\src\AnimatedEvent.js : Line 94:
this._callListeners = this._callListeners.bind(this);

@hramos
Copy link
Contributor

hramos commented Dec 19, 2018

@denchp can you provide more information? Please make sure to follow the template.

@gilad1987
Copy link

TypeError: TypeError: undefined is not an object (evaluating 'this._callListeners.bind')

This error is located at:
in StackViewLayout (at withOrientation.js:30)
in withOrientation (at StackView.js:79)
in RCTView (at View.js:45)
in View (at Transitioner.js:215)
in Transitioner (at StackView.js:22)
in StackView (created by Navigator)
in Navigator (at createKeyboardAwareNavigator.js:12)
in KeyboardAwareNavigator (at createAppContainer.js:388)
in NavigationContainer (at App.tsx:29)
in App (at renderApplication.js:34)
in RCTView (at View.js:45)
in View (at AppContainer.js:98)
in RCTView (at View.js:45)
in View (at AppContainer.js:115)
in AppContainer (at renderApplication.js:33)

This error is located at:
in NavigationContainer (at App.tsx:29)
in App (at renderApplication.js:34)
in RCTView (at View.js:45)
in View (at AppContainer.js:98)
in RCTView (at View.js:45)
in View (at AppContainer.js:115)
in AppContainer (at renderApplication.js:33)
AnimatedEvent
AnimatedEvent.js:94:46
event
AnimatedImplementation.js:504:42
StackViewLayout
StackViewLayout.js:111:6

createClassProxy.js:98:23
instantiate
createClassProxy.js:96:6
constructClassInstance
ReactNativeRenderer-dev.js:8864:26
updateClassComponent
ReactNativeRenderer-dev.js:11508:6
beginWork
ReactNativeRenderer-dev.js:12741:8
performUnitOfWork
ReactNativeRenderer-dev.js:16075:21
workLoop
ReactNativeRenderer-dev.js:16115:41
renderRoot
ReactNativeRenderer-dev.js:16219:15
performWorkOnRoot
ReactNativeRenderer-dev.js:17198:17
performWork
ReactNativeRenderer-dev.js:17099:24
performSyncWork
ReactNativeRenderer-dev.js:17060:14
requestWork
ReactNativeRenderer-dev.js:16925:19
scheduleWork
ReactNativeRenderer-dev.js:16724:16
scheduleRootUpdate
ReactNativeRenderer-dev.js:17413:15
updateContainerAtExpirationTime
ReactNativeRenderer-dev.js:17447:28
updateContainer
ReactNativeRenderer-dev.js:17537:4
render
ReactNativeRenderer-dev.js:18191:20
renderApplication
renderApplication.js:59:34
run
AppRegistry.js:101:10
runApplication
AppRegistry.js:195:26
__callFunction
MessageQueue.js:349:47

MessageQueue.js:106:26
__guard
MessageQueue.js:297:10
callFunctionReturnFlushedQueue
MessageQueue.js:105:17

=========

{
"name": "=====",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"android": "react-native run-android",
"android:log": "react-native log-android ",
"ios": "react-native run-ios",
"build:android": "cd android && ./gradlew assembleRelease",
"generate-homescreen-app": "yo rn-toolbox:assets --icon "
},
"dependencies": {
"@types/react-native-material-ui": "^1.31.0",
"@types/react-native-vector-icons": "^4.6.4",
"@types/react-navigation": "^3.0.1",
"babel-preset-mobx": "^2.0.0",
"mobx": "^4.0.0",
"mobx-react": "^5.4.3",
"react": "16.7.0",
"react-native": "0.57.8",
"react-native-animatable": "^1.3.0",
"react-native-gesture-handler": "^1.0.12",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-phone-call": "^1.0.9",
"react-native-swipeout": "^2.3.6",
"react-native-typescript-transformer": "^1.2.11"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.2.3",
"@types/jest": "^23.3.10",
"@types/node": "^10.12.18",
"@types/react": "^16.7.17",
"@types/react-native": "^0.57.19",
"@types/react-test-renderer": "^16.0.3",
"babel-jest": "23.6.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-native-animatable": "^1.3.0",
"react-native-calendars": "^1.21.0",
"react-native-elements": "^0.19.1",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-material-dropdown": "^0.11.1",
"react-native-material-ui": "^1.30.1",
"react-native-navigation": "^2.1.3",
"react-native-paper": "^2.2.6",
"react-native-ui-lib": "^3.5.0",
"react-native-vector-icons": "^6.1.0",
"react-navigation": "3.0.9",
"react-test-renderer": "16.7.0",
"typescript": "^3.2.2"
},
"jest": {
"preset": "react-native"
}
}

@djGrill
Copy link

djGrill commented Jan 9, 2019

@gilad1987 Any luck with this?

@hramos
Copy link
Contributor

hramos commented Jan 12, 2019

Closing after three weeks with no follow up from the original author.

@hramos hramos closed this as completed Jan 12, 2019
@eBotti

This comment has been minimized.

@israelmw

This comment has been minimized.

@hramos
Copy link
Contributor

hramos commented Feb 25, 2019

Please open a new issue.

@jaydeep987
Copy link

Wondering no one have solution?

@jaydeep987
Copy link

Wondering no one have solution?

Ok I got it!
In babel.config.js putting '@babel/plugin-transform-flow-strip-types' at first line in plugins worked! (Not inside env.test.plugins)

@baveku
Copy link

baveku commented Mar 6, 2019

Wondering no one have solution?

Ok I got it!
In babel.config.js putting '@babel/plugin-transform-flow-strip-types' at first line in plugins worked! (Not inside env.test.plugins)

Thanks, It's work for me =)))

@a1lu
Copy link

a1lu commented Mar 8, 2019

@jaydeep987 @baveku
I got the same issue, but this does not work for me. I added the line to babel.config.js and .babelrc

my .babel.config.js:


{
    "plugins": [
       '@babel/plugin-transform-flow-strip-types'
    ]
}

my .babelrc:

{
    "presets": ["module:metro-react-native-babel-preset"],
    "plugins": [
        '@babel/plugin-transform-flow-strip-types'
    ]
}

What works for me is downgrading react-native to 0.57.8

EDIT:
downgrading did not work on iOs.

But finally I got it:
Had to add '@babel/plugin-transform-flow-strip-types' to .babelrc


{
    "presets": ["module:metro-react-native-babel-preset",],
    "plugins": [
        ["@babel/plugin-transform-flow-strip-types"],
        ["@babel/plugin-proposal-decorators",
        {
            "legacy": true
        } ]
    ]
}

react-native 0.58.6

@vurso
Copy link

vurso commented Dec 25, 2019

Has anyone got an idea why this happens? I was building my react native project, everything was working fine and then booted up the project the next day and I get the say error:

(Windows 10 Pro, VS Code, Android Emulator, React Native project using a few screens, react-navigation, react-drawer etc - nothing special nothing extra).

TypeError: Cannot read property 'bind' of undefined

This error is located at:
in StackViewLayout (at withOrientation.js:30)
in withOrientation (at StackView.tsx:104)
in RCTView (at Transitioner.tsx:267)
in Transitioner (at StackView.tsx:41)
in StackView (at createNavigator.js:80)
in Navigator (at createKeyboardAwareNavigator.js:12)
in KeyboardAwareNavigator (at SceneView.js:9)
in SceneView (at SwitchView.js:12)
in SwitchView (at createNavigator.js:80)
in Navigator (at createAppContainer.js:430)
in NavigationContainer (at renderApplication.js:40)
in RCTView (at AppContainer.js:101)
in RCTView (at AppContainer.js:119)
in AppContainer (at renderApplication.js:39)
reportException @ index.bundle?platfor…&minify=false:25185
handleException @ index.bundle?platfor…&minify=false:25239
showErrorDialog @ index.bundle?platfor…&minify=false:41717
showErrorDialog @ index.bundle?platfor…&minify=false:20311
logCapturedError @ index.bundle?platfor…&minify=false:20315
logError @ index.bundle?platfor…&minify=false:20387
callback @ index.bundle?platfor…&minify=false:21495
callCallback @ index.bundle?platfor…&minify=false:14069
commitUpdateEffects @ index.bundle?platfor…&minify=false:14102
commitUpdateQueue @ index.bundle?platfor…&minify=false:14092
commitLifeCycles @ index.bundle?platfor…&minify=false:20615
commitLayoutEffects @ index.bundle?platfor…&minify=false:22933
invokeGuardedCallbackImpl @ index.bundle?platfor…e&minify=false:9073
invokeGuardedCallback @ index.bundle?platfor…e&minify=false:9169
commitRootImpl @ index.bundle?platfor…&minify=false:22740
unstable_runWithPriority @ index.bundle?platfor…&minify=false:42741
runWithPriority @ index.bundle?platfor…&minify=false:12619
commitRoot @ index.bundle?platfor…&minify=false:22602
runRootCallback @ index.bundle?platfor…&minify=false:21935
(anonymous) @ index.bundle?platfor…&minify=false:12665
unstable_runWithPriority @ index.bundle?platfor…&minify=false:42741
runWithPriority @ index.bundle?platfor…&minify=false:12619
flushSyncCallbackQueueImpl @ index.bundle?platfor…&minify=false:12660
flushSyncCallbackQueue @ index.bundle?platfor…&minify=false:12649
scheduleUpdateOnFiber @ index.bundle?platfor…&minify=false:21817
scheduleRootUpdate @ index.bundle?platfor…&minify=false:24242
updateContainerAtExpirationTime @ index.bundle?platfor…&minify=false:24267
updateContainer @ index.bundle?platfor…&minify=false:24358
render @ index.bundle?platfor…&minify=false:24987
renderApplication @ index.bundle?platfor…&minify=false:72743
run @ index.bundle?platfor…&minify=false:72323
runApplication @ index.bundle?platfor…&minify=false:72373
__callFunction @ index.bundle?platfor…e&minify=false:2674
(anonymous) @ index.bundle?platfor…e&minify=false:2387
__guard @ index.bundle?platfor…e&minify=false:2628
callFunctionReturnFlushedQueue @ index.bundle?platfor…e&minify=false:2386
(anonymous) @ debuggerWorker.d9da4ed7.js:4
Show 7 more frames
index.bundle?platfor…&minify=false:25185 TypeError: Cannot read property 'bind' of undefined

This error is located at:
in NavigationContainer (at renderApplication.js:40)
in RCTView (at AppContainer.js:101)
in RCTView (at AppContainer.js:119)
in AppContainer (at renderApplication.js:39)


After wasting an entire day trying everything I have given up on react native development for the time being its just too buggy and unstable (on Windows 10 with Android). If anyone can explain to me why this occurs without telling to hack some file that I didn't need to the day before I will buy you a drink.

@facebook facebook locked as resolved and limited conversation to collaborators Jan 12, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests