Skip to content

window is not defined #6080

@Luktm

Description

@Luktm

Window is not defined every time I was trying npm install reactjs modules

window is not defined after install react-chat-widget or any others reactjs modules

Error of Window is not defined when import react modules

when i import the module as picture below:

  1. import module
    import-widget

  2. use module into render function
    insert-render

  3. next.config.js with zeit/next-css npm package
    capture

  4. package.json
    package-json

Step to get error

Steps to produce the error after install react modules:

  1. Open cmd as administration
  2. run "yarn run dev"
  3. localhost:3000 started
  4. open chrome browser, refresh
  5. Unhandled Rejection (ReferenceError): window is not defined

Expected behavior

I expect react-chat-widget it can do like this as picture below after installed module:
react-chat-widget-snap

Screenshots of Error shows in browser after run it

capture

System information

  • OS: Windows
  • chrome
  • Version of Next.js: [e.g. 7.0.2]

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