reinitialize causes DOMException for missing or moved child node on Chrome Browser
See original GitHub issueThe error occurs, whenever the order config gets updated and is caused by the reinitialize function.
As an error example i point to the project-demo at https://enngage.github.io/ngx-paypal/.
Just change the Dollar amount of the order and get this:
ERROR DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is no longer a child of this node. Perhaps it was moved in response to a mutation?
The error is kind of odd, because it removes the child node as expected, but still throws an error.
So as a workaround just catching the error works.
Deps: Angular 11 ngx-paypal 6.2.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Failed to execute 'removeChild' on 'Node' - Stack Overflow
Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is no longer a child of this node. Perhaps it...
Read more >Node.removeChild() - Web APIs - MDN Web Docs
The removeChild() method of the Node interface removes a child node from the DOM and returns the removed node.
Read more >Changes - HtmlUnit - SourceForge
Use our own simple color class to reduce the java.awt dependencies. rbri. Remove, Element behaviors and HTML components (HTCs) have been removed from...
Read more >WebDriver - W3C
The browser chrome is a non-normative term to refer to the ... Nodes. The WebDriver protocol consists of communication between: Local end.
Read more >AccessibilityNodeInfo - Android Developers
Instead, you could traverse all the children to find the node. Or, use AccessibilityService#findFocus(int) for FOCUS_ACCESSIBILITY only since it has no such ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@huntonas Ok, my first hotfix was to alter this:
into this :
on line 313 of ngx-paypal.js
…but since i didn’t want to fork this repo and maintain my hotfix, i found a template based solution:
By not updating the component config, but recreating it with an ngIf Clause it never calls for reinitialize():
<ngx-paypal ngIf="payPalConfig" (scriptLoaded)="scriptLoaded($event)" [config]="payPalConfig"></ngx-paypal>
then simply set your payPalConfig to undefined first, to clear it from view before updating your payPalConfig.
Hope this helps
I am getting the exact same issue, thanks for the solution. This needs to be resolved by the maintainers of this library