Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot destructure property index of 'undefined' or 'null' #145

Open
ZPengs opened this issue Jul 27, 2019 · 0 comments
Open
Labels

Comments

@ZPengs
Copy link

ZPengs commented Jul 27, 2019

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
I call this method directly to prompt the error message

function screenshotevent(){
  var imgpath;
  screenshot.listDisplays()
  .then((displays) => {
    console.log(displays)
    for (let index = 0; index < displays.length; index++) {
      const display = displays[index]
      const imgpath = path.join(__dirname, Date.now() + '_' + index + '.png')
      screenshot({ screen: display.id, filename: imgpath }).then((imgpath) => {
        console.log(imgpath)
      }).catch(err => {
        console.error(err)
      })
    }
  });
}

image

Environment (please complete the following information):

  • OS:windows 7
  • Engine [e.g. Node, Electron]
  • Version 1.9.0

Additional context
Add any other context about the problem here.

@ZPengs ZPengs added the bug label Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant