question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught Error: Uncaught, unspecified "error" event. (Invalid namespace)

See original GitHub issue

You want to:

  • report a bug

Current behaviour

events.js:62 Uncaught Error: Uncaught, unspecified "error" event. (Invalid namespace)
    at Socket../node_modules/events/events.js.EventEmitter.emit (events.js:62)
    at Socket.<anonymous> (index.js:21)
    at Socket../node_modules/component-emitter/index.js.Emitter.emit (index.js:133)
    at Socket../node_modules/socket.io-client/lib/socket.js.Socket.emit (socket.js:136)
    at Socket../node_modules/socket.io-client/lib/socket.js.Socket.onpacket (socket.js:248)
    at Manager.<anonymous> (index.js:21)
    at Manager../node_modules/component-emitter/index.js.Emitter.emit (index.js:133)
    at Manager../node_modules/socket.io-client/lib/manager.js.Manager.ondecoded (manager.js:345)
    at Decoder.<anonymous> (index.js:21)
    at Decoder../node_modules/component-emitter/index.js.Emitter.emit (index.js:133)
----
./node_modules/events/events.js.EventEmitter.emit | @ | events.js:62
-- | -- | --
  | (anonymous) | @ | index.js:21
  | ./node_modules/component-emitter/index.js.Emitter.emit | @ | index.js:133
  | ./node_modules/socket.io-client/lib/socket.js.Socket.emit | @ | socket.js:136
  | ./node_modules/socket.io-client/lib/socket.js.Socket.onpacket | @ | socket.js:248
  | (anonymous) | @ | index.js:21
  | ./node_modules/component-emitter/index.js.Emitter.emit | @ | index.js:133
  | ./node_modules/socket.io-client/lib/manager.js.Manager.ondecoded | @ | manager.js:345
  | (anonymous) | @ | index.js:21
  | ./node_modules/component-emitter/index.js.Emitter.emit | @ | index.js:133
  | ./node_modules/socket.io-parser/index.js.Decoder.add | @ | index.js:241
  | ./node_modules/socket.io-client/lib/manager.js.Manager.ondata | @ | manager.js:335
  | (anonymous) | @ | index.js:21
  | ./node_modules/component-emitter/index.js.Emitter.emit | @ | index.js:133
  | ./node_modules/engine.io-client/lib/socket.js.Socket.onPacket | @ | socket.js:456
  | (anonymous) | @ | socket.js:273
  | ./node_modules/component-emitter/index.js.Emitter.emit | @ | index.js:133
  | ./node_modules/engine.io-client/lib/transport.js.Transport.onPacket | @ | transport.js:145
  | ./node_modules/engine.io-client/lib/transport.js.Transport.onData | @ | transport.js:137
  | ws.onmessage | @ | websocket.js:147
P.S. * (anonymous) index.js - file webpack:///./node_modules/component-emitter/index.js

Steps to reproduce

import * as io from "socket.io-client";

export const ss = require("socket.io-stream");

export const socket = io((process.env.NODE_ENV === "production" ? (window as any).location.origin : "http://localhost:1337") + "/socket_user", {
    reconnection: true,
    reconnectionAttempts: 10,
    reconnectionDelay: 1000,
    transports: ["websocket", "polling", "flashsocket"],
});

export const socketStream = io((process.env.NODE_ENV === "production" ? (window as any).location.origin : "http://localhost:1337") + "/socket_transfer", {
    reconnection: true,
    reconnectionAttempts: 10,
    reconnectionDelay: 1000,
    transports: ["websocket", "polling", "flashsocket"],
});

export const streamConnect = ss(socketStream);

socket.on("connect", () => {
    console.log("connect");
});
socket.on("event", () => {
    console.log("event");
});
socket.on("error", (error) => {
    console.error("error", error);
});

Setup

  • OS: Mac OS X 10.12.6 64-bit
  • browser: Opera 48.0.2685.39 / Chrome Version 61.0.3163.100
  • socket.io version: 2.0.3 / 2.0.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rotem925commented, Feb 28, 2018

Just to clarify, If there is an error thrown from the server (in my case an authorization middleware that return next with an error), first time the event error is trapped, second time onwards, we get to see this error.

1reaction
rotem925commented, Feb 28, 2018

I have the same issue, is this going to be handled?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Uncaught, unspecified "error" event. ([object Object])
I'm trying to push a notification if socket gets received. Server side: if(data.handle.length > 0 && data.
Read more >
Invalid namespace error when deploying module
Cause. The error points to an issue with the namespace definition. The namespaces in definitions.cnd of the module in question must have already...
Read more >
Web service error codes (Microsoft Dataverse) - Power Apps
The following list shows the error codes used in Dataverse. For more information about handling errors when using the Dataverse SDK for ....
Read more >
Error Handling in Express - Reflectoring
It invokes only the middleware function invalidPathHandler() at the end which sends an error message: invalid path with an HTTP status code of ......
Read more >
Firebase JavaScript SDK Release Notes - Google
Fixed a bug that caused Firebase SDKs to throw an error in Firefox browsers ... Fixed an uncaught rejection in isSupported() when the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found