-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
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) withngx-matomo-client@8.0.0. - Point
trackerUrlto 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!
Metadata
Metadata
Assignees
Labels
No labels