anthonygore / vue-js-laravel-multi-ssr

Source code for the article "Advanced Server-Side Rendering With Laravel & Vue: Multi-Page App"
https://vuejsdevelopers.com/2017/11/27/vue-js-laravel-server-side-rendering-router/
37 stars 6 forks source link

ReferenceError: url is not defined #5

Open hugo-z opened 5 years ago

hugo-z commented 5 years ago

entry-server.js

import renderVueComponentToString from 'vue-server-renderer/basic';
import app from './app';
import router from './plugins/router';

new Promise((resolve, reject) => {
  router.push(url);
  router.onReady(() => {
    const matchedComponents = router.getMatchedComponents();
    if (!matchedComponents.length) {
      return reject({ code: 404 });
    }
    resolve(app);
  }, reject);
}).then(app => {
    renderVueComponentToString(app, (err, res) => {
        print(res);
    });
}).catch((err) => {
    print(err);
});

I'm wondering where this global variable url is defined, I got this error when running $this->render() in the controller

Edited I know where went wrong. :)