felixhao28 / node-systray

A cross-platform systray library for nodejs.
https://www.npmjs.com/package/systray2
MIT License
32 stars 8 forks source link

systray failed to start: Cannot read properties of undefined (reading 'items') #10

Open UndarkAido opened 2 years ago

UndarkAido commented 2 years ago

My project is just the example except that I had to make to constructor new SysTray.default

systray failed to start: Cannot read properties of undefined (reading 'items')
-snip-\node_modules\systray2\index.js:179
    if (item.items != null) {
             ^

TypeError: Cannot read properties of undefined (reading 'items')
    at addInternalId (C-snip-\node_modules\systray2\index.js:179:14)      
    at -snip-\node_modules\systray2\index.js:301:87
    at Array.forEach (<anonymous>)
    at SysTray.<anonymous> (-snip-\node_modules\systray2\index.js:301:57)
    at step (-snip-\node_modules\systray2\index.js:52:23)
    at Object.next (-snip-\node_modules\systray2\index.js:33:53)
    at -snip-\node_modules\systray2\index.js:27:71
    at new Promise (<anonymous>)
    at __awaiter (-snip-\node_modules\systray2\index.js:23:12)
    at C-snip-\node_modules\systray2\index.js:285:99

Process finished with exit code 1
{
  "name": "wallpapergarden-client",
  "main": "main.js",
  "type": "module",
  "scripts": {
    "start": "node ."
  },
  "dependencies": {
    "systray2": "^2.1.4"
  }
}
felixhao28 commented 2 years ago

I cannot reproduce it. Can you share your project?

vimal commented 2 years ago

(node:29669) UnhandledPromiseRejectionWarning: TypeError: input.on is not a function
    at new Interface (readline.js:189:11)
    at Object.createInterface (readline.js:69:10)
    at SysTray.<anonymous> (/Users/vimaldas/node-dev/aws-uploader/node_modules/systray2/index.js:296:61)
    at step (/Users/vimaldas/node-dev/aws-uploader/node_modules/systray2/index.js:52:23)
    at Object.next (/Users/vimaldas/node-dev/aws-uploader/node_modules/systray2/index.js:33:53)
    at /Users/vimaldas/node-dev/aws-uploader/node_modules/systray2/index.js:27:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/vimaldas/node-dev/aws-uploader/node_modules/systray2/index.js:23:12)
    at /Users/vimaldas/node-dev/aws-uploader/node_modules/systray2/index.js:285:99
    at new Promise (<anonymous>)
(node:29669) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:29669) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```

I am on MacOS Catalina and just tried the code from the example
Systray version is 2.1.4
felixhao28 commented 2 years ago

@vimal Are you running the program from a shell, which supports standard output stream?

UndarkAido commented 2 years ago

I was running it through Webstorm on Windows, I deleted the project already. Could try to recreate it.