AmazingDreams / vue-matomo

Vue plugin for Matomo Analytics
MIT License
282 stars 61 forks source link

".default.trackPage is not a function" #10

Closed siulca closed 6 years ago

siulca commented 6 years ago

I'm using it in a project created with Vue CLI 3.

"vue": "^2.5.17", "vue-matomo": "^0.1.11", "vue-router": "^3.0.1",

Matomo seems to make router fail with the following error:

screen shot 2018-10-11 at 22 36 25

siulca commented 6 years ago

Router appears to be calling trackPage() which does not exist in matomo's API. Should it be trackPageView() ?

screen shot 2018-10-11 at 22 58 13

AmazingDreams commented 6 years ago

vue-matomo is definitely calling trackPageView (https://github.com/AmazingDreams/vue-matomo/blob/master/src/index.js#L46)

What do you have at src/main.js line 47? The stacktrace suggests it's being called there.

siulca commented 6 years ago

Line 47 is the closing bracket of the Vue() instance. It fails to initialize so it's pointing at that line.

But you're right, you're not calling trackPage(). And I did a file search and it's not being called in my code either! What else could it be?

AmazingDreams commented 6 years ago

It is weird. Do you think you can create a minimal reproduction script?

siulca commented 6 years ago

The minimal reproduction script works. I'll have to go through a process of elimination in my project to figure out what's going on. Not sure it's worth the trouble.

(As an aside, there's a coma missing in your instructions:) image https://www.npmjs.com/package/vue-matomo

AmazingDreams commented 6 years ago

Ah right, that was fixed after the latest release. I'll make a new release for the documentation fix. I will close this one for now, just reopen when you've found anything related to vue-matomo.