Rails 5 - Why we will get DOMException error in ReactJS? - javascript

In rails 5, I am using "react": "^15.4.1" for front-end.
I am getting an error like
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at removeChild (http://localhost:8080/js/main.js:20902:14)
at Object.processUpdates (http://localhost:8080/js/main.js:21046:11)
at Object.dangerouslyProcessChildrenUpdates [as processChildrenUpdates] (http://localhost:8080/js/main.js:82797:27)
at processQueue (http://localhost:8080/js/main.js:85253:29)
at ReactDOMComponent._updateChildren (http://localhost:8080/js/main.js:85471:9)
at ReactDOMComponent.updateChildren (http://localhost:8080/js/main.js:85415:12)
at ReactDOMComponent._updateDOMChildren (http://localhost:8080/js/main.js:82569:12)
at ReactDOMComponent.updateComponent (http://localhost:8080/js/main.js:82387:10)
at ReactDOMComponent.receiveComponent (http://localhost:8080/js/main.js:82349:10)
at Object.receiveComponent (http://localhost:8080/js/main.js:10257:22)
And also I am getting an another error like
Uncaught (in promise) TypeError: Cannot read property 'status' of undefined
at Function._onError (main.js:362)
at main.js:304
at <anonymous>
Why these errors will come? Please help me to solve this issue, I am new to ReactJS.

Related

Salesforce LWC Uncaught (in promise) TypeError: Cannot read property 'Symbol(ViewModel)' of undefined

I am getting this error when running a Salesforce scratch org application;
aura_proddebug.js:274 Uncaught (in promise) TypeError: Cannot read property 'Symbol(ViewModel)' of undefined
at getInternalField (aura_proddebug.js:274)
at Object.update (aura_proddebug.js:1793)
at updateCustomElmDefaultHook (aura_proddebug.js:5627)
at Object.update (aura_proddebug.js:5779)
at patchVnode (aura_proddebug.js:5021)
at updateStaticChildren (aura_proddebug.js:5000)
at aura_proddebug.js:5542
at runWithBoundaryProtection (aura_proddebug.js:8255)
at updateChildrenHook (aura_proddebug.js:5541)
at Object.update (aura_proddebug.js:5751)
Has anyone experienced this before?
I was actually able to spot the issue.
This error has been thrown before in my org when I either didn't have the .html file or I had it with an improper spelling somehow; include case sensitivity on the names.
See related here:

Angular 5 issue with 'removeEventListener' on 'EventTarget' only on prod build. but No issues on Dev build

The Console shows this
main.598d68d658cf204b66cd.bundle.js:1 ERROR TypeError: Failed to execute 'removeEventListener' on 'EventTarget': The callback provided as parameter 2 is not a function.
at r.(anonymous function).XMLHttpRequest.t.responseBlob.o.function.a.(anonymous function).r.(anonymous function).(anonymous function) [as __zone_symbol__open] (https://salty-fjord-85026.herokuapp.com/polyfills.62d8ac97edff2dddd48f.bundle.js:1:132920)
at https://salty-fjord-85026.herokuapp.com/polyfills.62d8ac97edff2dddd48f.bundle.js:1:142082
at r.(anonymous function).i.(anonymous function) [as open] (https://salty-fjord-85026.herokuapp.com/polyfills.62d8ac97edff2dddd48f.bundle.js:1:133379)
at t._subscribe (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:647355)
at t._trySubscribe (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:98272)
at t.subscribe (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:98101)
at e.a (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:695746)
at e._innerSub (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:718260)
at e._tryNext (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:718184)
at e._next (https://salty-fjord-85026.herokuapp.com/main.598d68d658cf204b66cd.bundle.js:1:718007)
but deployment was successful
you can visit the site dev server here
you can look at the code here github
and get in depth understanding of the issue.
thank you all in Advanced

angularjs - Ionic/Angular1 Tlantic/cdv-socket-plugin error

TypeError: Cannot read property 'isConnected' of null
at PosCommunicator.isConnected (app.all.min.js:2926)
at app.all.min.js:3298
at Scope.$emit (libs.all.min.js:56256)
at Object.emit (libs.all.min.js:83720)
at Object.transition (libs.all.min.js:83550)
at libs.all.min.js:85379
at libs.all.min.js:83428
at Object.render (libs.all.min.js:83517)
at Object.init (libs.all.min.js:83427)
at Object.self.render (libs.all.min.js:85373)
Uncaught TypeError: Cannot read property 'plugins' of undefined
at app.all.min.js:40
at Array.<anonymous> (libs.all.min.js:81844)
at onPlatformReady (libs.all.min.js:28102)
at onWindowLoad (libs.all.min.js:28083)
I installed Tlantic/cdv-socket-plugin
but socketplugin method cannot loaded ('isConnected' of null)
Anyone can help me to solve this problem.
https://github.com/Tlantic/cdv-socket-plugin

How to get the stacktrace of an error when using rxjs?

I'm using angular-cli to build a small angular2 web app and I'm debugging with chrome dev-tools.
Clearly I'm doing something wrong if I need to guess each time where is the source of the error and what is the stack-trace of that error.
Take for example this error:
error_handler.js:45EXCEPTION: Cannot read property 'provider' of nullErrorHandler.handleError # error_handler.js:45
error_handler.js:50ORIGINAL STACKTRACE:ErrorHandler.handleError # error_handler.js:50
error_handler.js:51TypeError: Cannot read property 'provider' of null
at MapSubscriber.project (auth.effects.ts:80)
at MapSubscriber._next (map.js:77)
at MapSubscriber.Subscriber.next (Subscriber.js:89)
at DistinctUntilChangedSubscriber._next (distinctUntilChanged.js:72)
at DistinctUntilChangedSubscriber.Subscriber.next (Subscriber.js:89)
at MapSubscriber._next (map.js:83)
at MapSubscriber.Subscriber.next (Subscriber.js:89)
at MapSubscriber._next (map.js:83)
at MapSubscriber.Subscriber.next (Subscriber.js:89)
at RefCountSubscriber.Subscriber._next (Subscriber.js:125)ErrorHandler.handleError # error_handler.js:51
zone.js:355Unhandled Promise rejection: Cannot read property 'provider' of null ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'provider' of null(…) TypeError: Cannot read property 'provider' of null
at MapSubscriber.project (http://localhost:4200/main.bundle.js:35342:83)
at MapSubscriber._next (http://localhost:4200/main.bundle.js:4171:35)
at MapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:395:18)
at DistinctUntilChangedSubscriber._next (http://localhost:4200/main.bundle.js:25485:30)
at DistinctUntilChangedSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:395:18)
at MapSubscriber._next (http://localhost:4200/main.bundle.js:4177:26)
at MapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:395:18)
at MapSubscriber._next (http://localhost:4200/main.bundle.js:4177:26)
at MapSubscriber.Subscriber.next (http://localhost:4200/main.bundle.js:395:18)
at RefCountSubscriber.Subscriber._next (http://localhost:4200/main.bundle.js:431:26)consoleError # zone.js:355
zone.js:357Error: Uncaught (in promise): TypeError: Cannot read property 'provider' of null
at resolvePromise (http://localhost:4200/main.bundle.js:93214:31)
at http://localhost:4200/main.bundle.js:93191:13
at ZoneDelegate.invoke (http://localhost:4200/main.bundle.js:92988:28)
at Zone.run (http://localhost:4200/main.bundle.js:92881:43)
at http://localhost:4200/main.bundle.js:93247:57
at ZoneDelegate.invokeTask (http://localhost:4200/main.bundle.js:93021:37)
at Zone.runTask (http://localhost:4200/main.bundle.js:92921:47)
at drainMicroTaskQueue (http://localhost:4200/main.bundle.js:93153:35)consoleError # zone.js:357
The problem:
This errors means nothing to me. It's completely uselss and un readble.
I got lucky that I saw this line (sometimes I dont get any indication where the error is): at MapSubscriber.project (auth.effects.ts:80) - This line is the only line that usefull here to get some idea how to fix that bug.
Trying to understand the stack-trace will be pointless because its all rxjs stack-trace.
My question:
I would like to know my code's stack-trace. Is that possible?
where in my code the subscription to that observable happens.
If its an observable from ngrx, then where in my code someone dispanched that action that causes the error.
Its more general question about how to debug async code with rxjs then fixing this specific bug.
It happened in the projection method you provided to a map operator. The clue is at the top of your stack. MapSubscriber.project.
Basically you read stack traces from the top. The top most call is where the error was thrown (or rethrown).
In RxJS 5, there are usually two or three calls per operator. Each operator has a subscriber named after it that does the work. MapSubscriber.Subscriber.next MapSubscriber._next etc

Meteor problems after 1.0.3.1 update

Yesterday I ran meteor update and updated to 1.0.3.1 and it broke what I was working on.
I'm not sure what broke, but even the hello world project that ships with meteor is broken. When I do:
meteor create test
cd test
meteor run
I get these errors:
minimongo.js:3193 Uncaught SyntaxError: Unexpected end of input
ddp.js:3557 Uncaught SyntaxError: Unexpected end of input
follower-livedata.js:24 Uncaught TypeError: Cannot read property 'DDP' of undefined
application-configuration.js:24 Uncaught TypeError: Cannot read property 'DDP' of undefined
mongo.js:1000 Uncaught SyntaxError: Unexpected end of input
autoupdate.js:25 Uncaught TypeError: Cannot read property 'DDP' of undefined
livedata.js:22 Uncaught TypeError: Cannot read property 'DDP' of undefined
observe-sequence.js:24 Uncaught TypeError: Cannot read property 'LocalCollection' of undefined
blaze.js:28 Uncaught TypeError: Cannot read property 'ObserveSequence' of undefined
ui.js:22 Uncaught TypeError: Cannot read property 'Blaze' of undefined
templating.js:23 Uncaught TypeError: Cannot read property 'Blaze' of undefined
spacebars.js:25 Uncaught TypeError: Cannot read property 'Blaze' of undefined
global-imports.js:9 Uncaught TypeError: Cannot read property 'DDP' of undefined
template.test.js:2 Uncaught ReferenceError: Template is not defined
test.js:5 Uncaught ReferenceError: Template is not defined
The test.js:5 points here:
(function(){if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.hello.helpers({ // <-error here
counter: function () {
return Session.get('counter');
}
});
I don't understand why this is causing an error.
The .html reads:
<template name="hello">
<button>Click Me</button>
<p>You've pressed the button {{counter}} times.</p>
</template>
which looks fine but maybe I am missing something.
UPDATE:
What I have tried so far:
I ran rm -rf .meteor then ran meteor rebuild and I got:
this is your first time using Meteor! Installing a Meteor distribution in your home directory.
######################################################################## 100.0%
Packages rebuilt.
which sounded good so I ran meteor run:
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
and still got the same errors. actually looks like it works!

Categories