Router is not defined server/main.js:251:9


I get this error iin my server main.js:

Exception while invoking method 'addEvent' ReferenceError: router is not defined
I20190813-13:31:55.477(2)?     at MethodInvocation.addEvent (server/main.js:251:9)

I use this like that normally work other places then in server main.js

this.$router.push({ name: "event", params: { eventId } });

The addEvent is a from a .vue page

made a hack until I find a better solution:"addEvent",, function(error, result) {

if (error) {

} else {
var newUrl = “/event/” + result;