question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a way for zonejs to not patch MutationObserver

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/zone.js

Description

Our application runs Angular and Salesforce’s Lightning Web Components in the same document. A component in their library depends on the MutationObserver to be the native implementation. Zone.js patches the MutationObserver unless we set flag, __Zone_disable_EventTarget = true. However we do not wish to set that flag.

Only work around that we found is to re-assign the Native Code implementation for MutationObserver found by window[Zone.__symbol__("MutationObserver")] before we load the component.

Wish for guidance or a solution to set zone.js to not patch the MutationObserver.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JiaLiPassioncommented, Apr 7, 2020

@mjyocca , there is a PR for this purpose https://github.com/angular/angular/pull/31657, since it is a breaking change, I will work on it for the next major version, your current walk around (re-assign the native MutationObserver is totally fine).

@splincode , could you give me a reproduce repo?

0reactions
angular-automatic-lock-bot[bot]commented, Jul 14, 2022

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular/angular - Gitter
i have a form created via formBuilder. I now want to do form.controls['name'].value = 'something', but this does not set the value of...
Read more >
Angular2 Directive: How to detect DOM changes
Angular does not provide something built-in for that purpose. You can use MutationObserver to detect DOM changes. @Directive({ selector: '[my-skrollr]', .
Read more >
MutationObserver.disconnect() - Web APIs - MDN Web Docs
The MutationObserver method disconnect() tells the observer to stop watching for mutations.
Read more >
zone.d.ts - UNPKG
Provide a way to attach data to zones * 4. Provide a context specific last frame error handling * 5. (Intercept blocking methods)...
Read more >
Listening to DOM Changes Using MutationObserver in Angular
In this article, we're going to learn how to build an Angular Directive that listens to DOM changes using MutationObserver Web API.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found