Skip to content

[Error ] window.addEventListener is not a function  #73

@JaeWangL

Description

@JaeWangL

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions