adityar15 / nuxt3socket

25 stars 9 forks source link

Unable to run - globalThis.clients is not defined #4

Open thedevsbuddy opened 1 year ago

thedevsbuddy commented 1 year ago

I installed the code and ran it but it is showing the error that forEach is called on undefined.

The clients array is being empty all the time.

{
    "url": "/api/sendmessage",
    "statusCode": 500,
    "statusMessage": "",
    "message": "Cannot read properties of undefined (reading 'forEach')",
    "stack": "<pre><span class=\"stack\">at <project_dir>/nuxt3socket/.nuxt/dev/index.mjs:570:18</span>\n<span class=\"stack internal\">at processTicksAndRejections (node:internal/process/task_queues:96:5)</span>\n<span class=\"stack internal\">at async Object.handler (<project_dir>/nuxt3socket/node_modules/h3/dist/index.mjs:723:19)</span>\n<span class=\"stack internal\">at async Server.toNodeHandle (<project_dir>/nuxt3socket/node_modules/h3/dist/index.mjs:798:7)</span></pre>"
}
simonjcarr commented 11 months ago

I'm getting the same error