I am trying to render server side code on page load by following https://medium.com/js-dojo/advanced-server-side-rendering-with-laravel-vue-multi-page-app-486b706e654 . Everything works fine but when I try to use global variable "window" or "document"
my app.js code is
import App from './components/App.vue';
import Vue from 'vue';
import { createRouter } from './router'
import { createStore } from './store'
import { sync } from 'vuex-router-sync'
require('./bootstrap');
The bootstrap.js is normal as
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
I need axios globally but php V8Js gives error
V8Js::compileString():612: TypeError: window is undefined
I found that V8Js doesn't have browser variables and I tried using npm package browser-env but getting same error. see the screenshot http://nimb.ws/zGDmXO
Thank you