Skip to content

A self-hosted media server and file management system

fix: plausible error can block router.afterEach

aminnausinc8b30e09c419
diff --git a/resources/js/router/index.ts b/resources/js/router/index.ts
index 5f615431..2a686f9a 100644
--- a/resources/js/router/index.ts
+++ b/resources/js/router/index.ts
@@ -226,8 +226,12 @@ router.beforeEach(async (to, from, next) => {
router.afterEach((to) => {
nProgress.done(true);
- if (typeof window.plausible === 'function') {
- window.plausible('pageview', { u: to.fullPath });
+ try {
+ if (typeof window.plausible === 'function') {
+ window.plausible('pageview', { u: to.fullPath });
+ }
+ } catch (error) {
+ console.warn('Plausible Failed', error);
}
// Scroll to top on every spa page load