Skip to content

Commit f3ca730

Browse files
committed
fix: adblocker errors
If people use adblockers, the page routing would break. This now is now being handled.
1 parent 9511999 commit f3ca730

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

middleware/fathom.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ const { namespace } = options
55

66
Middleware[namespace] = ({ app, route }) => {
77
if(process.client) {
8-
app.$fathom.trackPageview({
9-
url: route.fullPath
10-
})
8+
try {
9+
app.$fathom?.trackPageview({
10+
url: route.fullPath
11+
})
12+
} catch (error) {
13+
// possibility that an adblocker is being used...
14+
console.log(error)
15+
}
1116
}
1217
}

0 commit comments

Comments
 (0)