sindresorhus / get-windows

Get metadata about the active window and open windows (title, id, bounds, owner, etc)
MIT License
783 stars 161 forks source link

getOpenWindows() -> parseMac() -> JSON.parse issues #171

Open tom2strobl opened 1 year ago

tom2strobl commented 1 year ago

My users ran 5 times into this issue:

Error: Error parsing window data
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at parseMac (<redacted>/node_modules/active-win/lib/macos.js:11:15)
    at AsyncFunction.module.exports.getOpenWindows

It corresponds to this JSON.parse() call: https://github.com/sindresorhus/active-win/blob/27221e5da0a64025bdec8759605694ea84ff9f68/lib/macos.js#L9C1-L16C3

might be related to #170