umi-server icon indicating copy to clipboard operation
umi-server copied to clipboard

[Error ] window.addEventListener is not a function

Open JaeWangL opened this issue 6 years ago • 0 comments

What happens?

When I use ssr,

C:\Users\jnso5\Desktop\Test\node_modules\dva-core\dist\index.js:1291
          throw _iteratorError3;
          ^

TypeError: window.addEventListener is not a function
    at setup (C:\Users\jnso5\Desktop\Test\dist/umi.server.js:1:314222)
    at run (C:\Users\jnso5\Desktop\Test\node_modules\dva-core\dist\index.js:952:24)

and in my 'models'

            window.addEventListener('resize', () => {
                isMobileView();
                isMenuToggled();
            });

This error bother me

How can I fix this?? when not using ssr, no problem And now use with just koa.js example

JaeWangL avatar Mar 10 '20 03:03 JaeWangL