Element: Window is not defined in popper.js

Created on 28 Oct 2016  ·  10Comments  ·  Source: ElemeFE/element

I got this error when applying ElementUI to Evan You's vue-hackernews-2.0 repository.

webpack:bundle is now VALID.
error during render : /
ReferenceError: window is not defined
at D:\code\vue\bachelor-defense\node_modules\element-ui\lib\utils\popper.js:51:16
at root (D:\code\vue\bachelor-defense\node_modules\element-ui\lib\utils\popper.js:42:26)
at Object. (D:\code\vue\bachelor-defense\node_modules\element-ui\lib\utils\popper.js:47:3)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

I use the recommended conf but can't figure out why.
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
I need explanation.

question

Most helpful comment

@Atinux Hi, Element now supports SSR and can work with nuxt.js :)

All 10 comments

vue-hackernews-2.0 applied SSR, and window is undefined in a Node environment. See #333 for more information.

My God! @Leopoldthecoder, Thanks for your explanation! Maybe I have to use another UI framework...

Hi @Leopoldthecoder is there any way that Element supports server-side rendering?

Now Element doesn't support SSR, and we have no such plan in short term. Sorry.

No problem @Leopoldthecoder, it was for me to know if it will be compatible with nuxt.js

@Atnux save problem with nuxt.js when use http://element.eleme.io/#/en-US

@Atnux same problem with nuxt.js when i try to work with element-ui

@Atinux Hi, Element now supports SSR and can work with nuxt.js :)

You guys rock @Leopoldthecoder 👏

@Leopoldthecoder great!

Was this page helpful?
0 / 5 - 0 ratings