When using mode: 'deferred', if the Matomo server can’t be reached (e.g. network outage or a self‑hosted instance down), the <script> load never resolves and the Angular app appears stuck in “infinite loading”. I couldn’t find any documented option to set a load timeout or handle load errors, so I may be missing something.
Reproduction
- Configure
provideMatomo({ mode: 'deferred', … }) in an Angular app (v20.1.2) with ngx-matomo-client@8.0.0.
- Point
trackerUrl to an invalid or downed Matomo endpoint.
- Serve the app and see in the console:
Loading failed for the <script> with source “https://…/matomo.js”.
- The app’s bootstrap never completes, preventing further rendering.
Expected behaviour
- Ideally there’d be a documented way to specify a timeout for the injected
<script> (for example, 5 seconds).
- On timeout or load error, the library could:
- Stop waiting for the script.
- Log a warning or emit an event/observable.
- Allow the Angular bootstrap to finish normally.
- Even better, if script injection and its error handling were fully non‑blocking, so a Matomo load issue wouldn’t hold up app initialization.
Thanks for any guidance or for considering this enhancement!
When using
mode: 'deferred', if the Matomo server can’t be reached (e.g. network outage or a self‑hosted instance down), the<script>load never resolves and the Angular app appears stuck in “infinite loading”. I couldn’t find any documented option to set a load timeout or handle load errors, so I may be missing something.Reproduction
provideMatomo({ mode: 'deferred', … })in an Angular app (v20.1.2) withngx-matomo-client@8.0.0.trackerUrlto an invalid or downed Matomo endpoint.Expected behaviour
<script>(for example, 5 seconds).Thanks for any guidance or for considering this enhancement!