title: RangeError: Maximum call stack size exceeded when trying to log out
body: <p>I'm making a simple app using Vue.js and vue router. I'm getting this error when trying to log out of my app:</p>
  
  <pre><code>vue-router.esm.js?8c4f:2827 Uncaught (in promise) RangeError: Maximum call stack size exceeded
      at RegExp.exec (&lt;anonymous&gt;)
      at RegExp.[Symbol.match] (&lt;anonymous&gt;)
      at String.match (&lt;anonymous&gt;)
      at matchRoute (vue-router.esm.js?8c4f:1636)
      at match (vue-router.esm.js?8c4f:1518)
      at redirect (vue-router.esm.js?8c4f:1578)
      at _createRoute (vue-router.esm.js?8c4f:1617)
      at match (vue-router.esm.js?8c4f:1519)
      at redirect (vue-router.esm.js?8c4f:1578)
      at _createRoute (vue-router.esm.js?8c4f:1617)
  replace @ vue-router.esm.js?8c4f:2827
  logout @ App.vue?234e:64
  click @ App.vue?4de4:34
  invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1854
  invoker @ vue.runtime.esm.js?2b0e:2179
  original._wrapper @ vue.runtime.esm.js?2b0e:6917
  3
  </code></pre>
  
  <p>Here's my router.js: </p>
  
  <pre><code>import Vue from "vue";
  import Router from "vue-router";
  import Home from "./views/Home.vue";
  import Login from "./views/Login.vue";
  
  import auth from "./auth";
  
  Vue.use(Router);
  
  export default new Router({
    mode: "history",
    base: process.env.BASE_URL,
    routes: [
      {
        path: "/dashboard",
        name: "home",
        component: Home,
        beforeEnter: requireAuth
      },
      {
        path: "/",
        name: "login",
        component: Login,
        redirect: () =&gt; {
          if (auth.loggedIn()) return "/dashboard";
          else return "/";
        }
      },
      {
        path: "/users",
        name: "users",
        component: () =&gt; import("./views/Users.vue"),
        beforeEnter: requireAuth
      },
      {
        path: "/plans",
        name: "plans",
        component: () =&gt; import("./views/Plans.vue"),
        beforeEnter: requireAuth
      },
      {
        path: "/meetups",
        name: "meetups",
        component: () =&gt; import("./views/Meetups.vue"),
        beforeEnter: requireAuth
      },
      {
        path: "/notif",
        name: "notifications",
        component: () =&gt; import("./views/Notifications.vue"),
        beforeEnter: requireAuth
      },
      {
        path: "/admins",
        name: "admins",
        component: () =&gt; import("./views/Admins.vue"),
        beforeEnter: requireAuth
      },
      {
        path: "/about",
        name: "about",
        component: () =&gt; import("./views/About.vue"),
        beforeEnter: requireAuth
      }
    ]
  });
  
  function requireAuth(to, from, next) {
    if (!auth.loggedIn()) {
      next({
        path: "/login",
        query: { redirect: to.fullPath }
      });
    } else {
      next();
    }
  }
  </code></pre>
  
  <p>Here's my logout function: </p>
  
  <pre><code>logout() {
        auth.logout();
        this.$router.replace("/");
      }
  </code></pre>
  
  <p>The app is a simple dashboard for showing some stats. I'm using a custom auth using firebase etch. It was working earlier I don't know what i did to breakt it pls help!
  <strong>Update</strong> I get another error when using code suggested in error, not sure what this error is about:</p>
  
  <pre><code>TypeError: Cannot read property 'name' of null
      at Proxy.render (eval at ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3092cd10-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/App.vue?vue&amp;type=template&amp;id=7ba5bd90&amp; (app.js:1116), &lt;anonymous&gt;:30:55)
      at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3548)
      at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4066)
      at Watcher.get (vue.runtime.esm.js?2b0e:4479)
      at new Watcher (vue.runtime.esm.js?2b0e:4468)
      at mountComponent (vue.runtime.esm.js?2b0e:4073)
      at VueComponent.Vue.$mount (vue.runtime.esm.js?2b0e:8415)
      at init (vue.runtime.esm.js?2b0e:3118)
      at createComponent (vue.runtime.esm.js?2b0e:5978)
      at createElm (vue.runtime.esm.js?2b0e:5925)
  </code></pre>