Cannot read property 'func' of undefined - reactjs

I'm getting the following 2 errors with my React Native project, using Expo in the Simulator.
Can anyone shed any light on what I should be looking to fix? I've seen a couple of people with similar 'undefined' issues but I was unable to a gain a solution from them. I'm not even sure which file I should be looking at! ExceptionsManager.js is a file inside 'node_modules/react-native' so does that mean anything? Any ideas?
Many thanks.
Cannot read property 'func' of undefined - ExceptionsManager.js:65
handleException # ExceptionsManager.js:65
handleError # InitializeCore.js:106
reportFatalError # error-guard.js:46
guardedLoadModule # require.js:133
_require # require.js:118
(anonymous) # config.json:1
executeApplicationScript # debuggerWorker.js:40
(anonymous) # debuggerWorker.js:65
Module AppRegistry is not a registered callable module (calling runApplication) - ExceptionsManager.js:65
handleException # ExceptionsManager.js:65
handleError # InitializeCore.js:106
reportFatalError # error-guard.js:46
__guard # MessageQueue.js:267
callFunctionReturnFlushedQueue # MessageQueue.js:115
(anonymous) # debuggerWorker.js:72

Related

Error: Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'?

I'm getting this error on every render. The stack trace below started with a mouse §click. The problem is I have no clue how to approach this. What I gather from this trace is:
It seems to happen inside React
Apparently it happens while React is reconciling the virtual DOM and the real DOM?
Somehow React Navigation has hooked into this process and is complaining.
And here it ends for me.
What am I using:
Expo Go SDK 46
React Native Web 0.18.7
Reactflow 11.2.0
So how do I go about debugging this? BTW I did wrap everything in a navigation container.
console.<computed> # index.js:1
error # react-native-logs.fx.ts:34
overrideMethod # react_devtools_backend.js:4026
i # VM8448:10
t.onCommitFiberRoot.t.onCommitFiberRoot # VM8448:10
onCommitRoot # react-dom.development.js:4875
commitRootImpl # react-dom.development.js:26709
commitRoot # react-dom.development.js:26517
performSyncWorkOnRoot # react-dom.development.js:25956
flushSyncCallbacks # react-dom.development.js:11982
flushSyncCallbacksOnlyInLegacyMode # react-dom.development.js:11961
scheduleUpdateOnFiber # react-dom.development.js:25326
dispatchReducerAction # react-dom.development.js:17269
listener # index.js:138
(anonymous) # index.js:18
setState # index.js:17
(anonymous) # index.ts:21
setNodes # slice.ts:120
(anonymous) # SlideEditorCanvas.tsx:139
(anonymous) # index.js:2308
call # dispatch.js:57
emit # zoom.js:219
start # zoom.js:198
mousedowned # zoom.js:283
(anonymous) # on.js:3

UseNavigate is giving error in my project

When i am importing { useNavigate } from "react-router-dom" my app is working fine but when i am doing this let navigate = useNavigate(); i am getting error and my project not running. I am getting this Error
react_devtools_backend.js:4026 The above error occurred in the <App> component:
at App (http://localhost:3000/main.275edd721dcd59139133.hot-update.js:41:84)
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
overrideMethod # react_devtools_backend.js:4026
logCapturedError # react-dom.development.js:18687
update.callback # react-dom.development.js:18720
callCallback # react-dom.development.js:13923
commitUpdateQueue # react-dom.development.js:13944
commitLayoutEffectOnFiber # react-dom.development.js:23391
commitLayoutMountEffects_complete # react-dom.development.js:24688
commitLayoutEffects_begin # react-dom.development.js:24674
commitLayoutEffects # react-dom.development.js:24612
commitRootImpl # react-dom.development.js:26823
commitRoot # react-dom.development.js:26682
performSyncWorkOnRoot # react-dom.development.js:26117
flushSyncCallbacks # react-dom.development.js:12042
flushSync # react-dom.development.js:26201
scheduleRefresh # react-dom.development.js:27795
renderer.scheduleRefresh # react_devtools_backend.js:6514
(anonymous) # react-refresh-runtime.development.js:304
performReactRefresh # react-refresh-runtime.development.js:293
(anonymous) # RefreshUtils.js:85
setTimeout (async)
enqueueUpdate # RefreshUtils.js:83
executeRuntime # RefreshUtils.js:243
$ReactRefreshModuleRuntime$ # App.js:72
./src/App.js # App.js:72
options.factory # react refresh:6
__webpack_require__ # bootstrap:24
_requireSelf # hot module replacement:102
apply # jsonp chunk loading:444
(anonymous) # hot module replacement:344
internalApply # hot module replacement:342
(anonymous) # hot module replacement:279
waitForBlockingPromises # hot module replacement:233
(anonymous) # hot module replacement:277
Promise.then (async)
(anonymous) # hot module replacement:276
Promise.then (async)
(anonymous) # hot module replacement:256
Promise.then (async)
hotCheck # hot module replacement:247
check # dev-server.js:13
(anonymous) # dev-server.js:55
emit # events.js:153
reloadApp # reloadApp.js:46
warnings # index.js:227
(anonymous) # socket.js:60
client.onmessage # WebSocketClient.js:50
Please any one tell why this is happening with me.
Actually I am not using the router that's why i am getting this error when i have used router in my project my project has been started.if you are also facing this issues please use router.

AngularJS $injector error on force refresh

I'm using AngularJS 1.6 with webpack.
When I force a refresh in Chrome (Shift+F5) my app fails to bootstrap and I get the following error:
app-a1677133c4.js:101030Uncaught TypeError: Cannot read property 'substr' of null
at app-a1677133c4.js:101030
at app-a1677133c4.js:101030
at Object.<anonymous> (app-a1677133c4.js:101030)
at Object.<anonymous> (app-a1677133c4.js:101031)
at __webpack_require__ (app-a1677133c4.js:20)
at app-a1677133c4.js:116
at Object.<anonymous> (app-a1677133c4.js:289)
at __webpack_require__ (app-a1677133c4.js:20)
at Object.<anonymous> (app-a1677133c4.js:47)
at __webpack_require__ (app-a1677133c4.js:20)
(anonymous) # app-a1677133c4.js:101030
(anonymous) # app-a1677133c4.js:101030
(anonymous) # app-a1677133c4.js:101030
(anonymous) # app-a1677133c4.js:101031
__webpack_require__ # app-a1677133c4.js:20
(anonymous) # app-a1677133c4.js:116
(anonymous) # app-a1677133c4.js:289
__webpack_require__ # app-a1677133c4.js:20
(anonymous) # app-a1677133c4.js:47
__webpack_require__ # app-a1677133c4.js:20
(anonymous) # app-a1677133c4.js:40
(anonymous) # app-a1677133c4.js:43
app-a1677133c4.js:11195 Uncaught Error: [$injector:modulerr] Failed to instantiate module scheduleApp due to:
Error: [$injector:nomod] Module 'scheduleApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.6.1/$injector/nomod?p0=scheduleApp
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13310:18
at ensure (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13234:39)
at module (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13308:15)
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15863:23
at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=scheduleApp&p1=Erro…host%3A5000%2Fstatic%2Fscheduling-angular%2Fapp-a1677133c4.js%3A12986%3A13)
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13310:18
at ensure (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13234:39)
at module (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13308:15)
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15863:23
at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=scheduleApp&p1=Erro…host%3A5000%2Fstatic%2Fscheduling-angular%2Fapp-a1677133c4.js%3A12986%3A13)
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15886:16
at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
at angularInit (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12871:6)
at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:44104:6
at HTMLDocument.trigger (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:14441:6)
The app is called "scheduleApp" - the module that fails to load and is referenced in the above error.
On a second normal refresh (ctr+r) everything works fine.
I'm not really sure how to debug this. Any thoughts?
Update
Turns out it was the AdGuard plugin I had installed in Chrome. Disabling the plugin for my site solved the issue.
It would be nice to understand the possible reasons for why my app was being disrupted by the plugin, for example whether there is something going on internally in my app that is against best practices causing AdGuard to label it as suspicious, or perhaps this is just an idiosyncrasy of AdGuard. Unfortunately AdGuard provides no insights into this - it does not actually report any blocking activity.

Uncaught TypeError: Cannot read property 'currentUser' of undefined

app.js
service.js
When I run localhost in console I have error
bundle.js:7541 Uncaught TypeError: Cannot read property 'currentUser'
of undefined(anonymous function) # bundle.js:7541invoke #
bundle.js:12268(anonymous function) # bundle.js:12076forEach #
bundle.js:7880createInjector # bundle.js:12076doBootstrap #
bundle.js:9310bootstrap # bundle.js:9331angularInit #
bundle.js:9216(anonymous function) # bundle.js:39027j #
jquery.js:3047fireWith # jquery.js:3159ready # jquery.js:3365I #
jquery.js:3380
Please help (I think I forgot something)
Inside app.js you have $window.localStorage.currentUser.
$window.localStorage is undefined and so you get the error that can't find currentUser of undefined.
change to: if ($window.localStorage && $window.localStorage.currentUser)

I am getting few errors on angularjs app which I am not sure why it's coming?

Hi I was working on angular app after few changes I am getting an error which I am not sure why it's coming.
error : TypeError: a is not a function
at angular.min.js:70
at m.promise.then.u (angular.min.js:97)
at m.promise.then.u (angular.min.js:97)
at angular.min.js:98
at h.$get.h.$eval (angular.min.js:108)
at h.$get.h.$digest (angular.min.js:106)
at h.$get.h.$apply (angular.min.js:109)
at f (angular.min.js:71)
at F (angular.min.js:75)
at XMLHttpRequest.x.onreadystatechange (angular.min.js:76)(anonymous function) # angular.min.js:89$get # angular.min.js:66m.promise.then.u # angular.min.js:97m.promise.then.u # angular.min.js:97(anonymous function) # angular.min.js:98$get.h.$eval # angular.min.js:108$get.h.$digest # angular.min.js:106$get.h.$apply # angular.min.js:109f # angular.min.js:71F # angular.min.js:75x.onreadystatechange # angular.min.js:76XMLHttpRequest.send (async)b # angular.min.js:77z # angular.min.js:72$get.f # angular.min.js:70m.promise.then.u # angular.min.js:97m.promise.then.u # angular.min.js:97(anonymous function) # angular.min.js:98$get.h.$eval # angular.min.js:108$get.h.$digest # angular.min.js:106$get.h.$apply # angular.min.js:109(anonymous function) # angular.min.js:18d # angular.min.js:34c # angular.min.js:17$b # angular.min.js:18Wc # angular.min.js:17(anonymous function) # angular.min.js:209v.Callbacks.l # jquery.min.js:2v.Callbacks.c.fireWith # jquery.min.js:2v.extend.ready # jquery.min.js:2A # jquery.min.js:2
I am not sure why this is coming and I am getting such 15 errors. It is not breaking my app but I am seeing this on chrome console.
I have changed from min.js to .js got this error :
TypeError: fn is not a function at angular.js:7946
at wrappedCallback (angular.js:11319)
at wrappedCallback (angular.js:11319)
at angular.js:11405
at Scope.$eval (angular.js:12412)
at Scope.$digest (angular.js:12224)
at Scope.$apply (angular.js:12516)
at done (angular.js:8204)
at completeRequest (angular.js:8412)
at XMLHttpRequest.xhr.onreadystatechange (angular.js:8351)(anonymous function) # angular.js:9778
As you cant place code in plunker I can only guess.
Are you passing any parameter to callback function? Usually it happens when you pass something like
.success($scope.message = "Task completed")
to in-build angular functions. In above case when the Ajax call completes, it is being invoked as a function, thus causing the error. It should have been as
.success(function () {
$scope.message = "Task completed";
})
In your case you may be assigning "a" to some variable.

Resources