Home

Issue: 2996

document is not defined from webpack in SSR

[issue link]

Hi,

after upgrading to nuxt 1.4.0 from 1.3.0 I got an error from weback document is not defined in SSR. I ran yarn dev

nuxt:render Rendering url / +0ms
{ ReferenceError: document is not defined
    at addStyle (webpack-internal:///11:116:22)
    at addStylesToDom (webpack-internal:///11:100:20)
    at module.exports (webpack-internal:///11:54:3)
    at eval (webpack-internal:///10:8:37)
    at Object.<anonymous> (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:146:1)
    at __webpack_require__ (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:30:30)
    at eval (webpack-internal:///0:3:1)
    at Object.<anonymous> (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:83:1)
    at __webpack_require__ (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:30:30)
    at eval (webpack-internal:///3:2:77)
    at Object.<anonymous> (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:104:1)
    at __webpack_require__ (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:30:30)
    at C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:76:18
    at C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:79:10
    at webpackUniversalModuleDefinition (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:3:20)
    at Object.<anonymous> (C:\Users\ellen\my-site\node_modules\vue2-highcharts\dist\vue-highcharts.js:10:3)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) statusCode: 500, name: 'ReferenceError' }

Whats wrong? In 1.3.0 it works correctly.

This question is available on Nuxt.js community (#c2596)