Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using Zoneless change detection #1015

Open
spock123 opened this issue May 7, 2024 · 2 comments
Open

Error using Zoneless change detection #1015

spock123 opened this issue May 7, 2024 · 2 comments

Comments

@spock123
Copy link

spock123 commented May 7, 2024

Hi,

  • Toastr works great - however when adding the new Zoneless changedetection in Angular 18, I get this error when trying to create a toast:

Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value for 'display': 'none'. Current value: 'undefined'. Expression location: _Toast component.

Any ideas what it could be? Thanks

As soon as I enable normal zoneJs again, it works without errors

@spock123
Copy link
Author

spock123 commented May 7, 2024

After looking at the source code I guess it's due to the use of NgZone in the. toastr.component.ts file.

@spock123
Copy link
Author

spock123 commented May 7, 2024

Back again - sorry for the spam. I actually think the reason is that , due to Angular/Fire issues, we had to keep ZoneJS in the angular.json polyfills, and still use the zoneless change detector.

For some reason this seems to mean ngx-toastr thinks ZoneJS is present, even though there is no change detection running.

Would it be a big task to make wether to use zoneJS or not, a configuration setting when providing the module?
THen we could manually specify wether to use zoneJS or not, instead of relying the library to "guess".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant