Skip to content

Commit a7dcc7d

Browse files
committed
fix(middleware): middleware only in client process
added a check wether the process is executed by the client
1 parent 7eaf672 commit a7dcc7d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

middleware/fathom.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ const options = JSON.parse(`<%= JSON.stringify(options) %>`)
44
const { namespace } = options
55

66
Middleware[namespace] = ({ app, route }) => {
7-
app.$fathom.trackPageview({
8-
url: route.fullPath
9-
})
7+
if(process.client) {
8+
app.$fathom.trackPageview({
9+
url: route.fullPath
10+
})
11+
}
1012
}
11-

0 commit comments

Comments
 (0)