AngularJS $injector error on force refresh - angularjs

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.

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.

How to fix: Uncaught TypeError: Cannot create property '_updatedFibers' on number '0' in react?

How to fix: Uncaught TypeError: Cannot create property '_updatedFibers' on number '0' in react?
Uncaught TypeError: Cannot create property '_updatedFibers' on number '0'
at requestUpdateLane (react-dom.development.js:25307:1)
at updateContainer (react-dom.development.js:28763:1)
at ReactDOMRoot.ReactDOMHydrationRoot.render.ReactDOMRoot.render (react-dom.development.js:29216:1)
at Module../src/index.js (index.js:15:1)
at Module.options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at startup:7:1
at startup:7:1
enter image description here
Make sure all your packages are upToDate with the latest react.
you can update using the following example:
yarn add react#latest react-dom#latest boostrap#latest ....so on

React: Maximum update depth exceeded when running two react projects on port 3000 and port 3001

When starting up a React project I saw the following message:
Something is already running on port 3000 [it was another React
project of mine].
Would you like to run the app on another port instead? › (Y/n)
I agreed and it ran my project on port 3001, which mysteriously caused the following error:
Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
at checkForNestedUpdates (react-dom.development.js:23093)
at scheduleUpdateOnFiber (react-dom.development.js:21164)
at Object.enqueueSetState (react-dom.development.js:12639)
at Router.push../node_modules/react/cjs/react.development.js.Component.setState (react.development.js:471)
at Router.js:34
at listener (history.js:155)
at history.js:173
at Array.forEach (<anonymous>)
at Object.notifyListeners (history.js:172)
at setState (history.js:288)
at history.js:402
at Object.confirmTransitionTo (history.js:145)
at replace (history.js:385)
at Lifecycle.onUpdate (Redirect.js:53)
at Lifecycle.componentDidUpdate (Lifecycle.js:9)
at commitLifeCycles (react-dom.development.js:19835)
at commitLayoutEffects (react-dom.development.js:22803)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
at invokeGuardedCallback (react-dom.development.js:292)
at commitRootImpl (react-dom.development.js:22541)
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11039)
at commitRoot (react-dom.development.js:22381)
at finishSyncRender (react-dom.development.js:21807)
at performSyncWorkOnRoot (react-dom.development.js:21793)
at react-dom.development.js:11089
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11039)
at flushSyncCallbackQueueImpl (react-dom.development.js:11084)
at flushSyncCallbackQueue (react-dom.development.js:11072)
at unbatchedUpdates (react-dom.development.js:21909)
at legacyRenderSubtreeIntoContainer (react-dom.development.js:24757)
at Object.render (react-dom.development.js:24840)
at Module.<anonymous> (index.js:16)
at Module../src/index.js (index.js:33)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object.1 (withProtectedLayout.js:7)
at __webpack_require__ (bootstrap:856)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
index.js:1 The above error occurred in the <Lifecycle> component:
in Lifecycle (created by Context.Consumer)
in Redirect (at authRoute.js:13)
in Route (at authRoute.js:7)
in AuthRoute (at App.js:82)
in Switch (at App.js:58)
in App (at src/index.js:20)
in Router (at src/index.js:19)
in Provider (at src/index.js:18)
react-dom.development.js:11102 Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
[stack trace removed]
I later found that stopping my other project and letting this project run on port 3000 resolved the error but I have no idea why it solved it.

Cannot read property 'func' of undefined

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

Resources