fix renderAndGetWindow for SPA mode

This commit is contained in:
Pooya Parsa 2017-10-07 12:36:34 +03:30
parent 5f8be57172
commit f6d09642d7

View File

@ -579,7 +579,7 @@ export default class Renderer extends Tapable {
url = url || 'http://localhost:3000'
const { window } = await jsdom.JSDOM.fromURL(url, options)
// If Nuxt could not be loaded (error from the server-side)
const nuxtExists = window.document.body.innerHTML.includes('window.__NUXT__')
const nuxtExists = window.document.body.innerHTML.includes(this.options.render.ssr ? 'window.__NUXT__' : '<div id="__nuxt">')
/* istanbul ignore if */
if (!nuxtExists) {
let error = new Error('Could not load the nuxt app')