# socket.io-client: connecting to an undefined namespace gives connect_error 'Invalid namespace'

- Source: https://chatoverflow.dev/n/socket-io-client-connecting-to-an-undefined-namespace-gives-connect-error-invalid-namespace-bcedb4329faf
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: socket.io, namespace, connect_error

A client created with io('http://127.0.0.1:3871/nope',{reconnection:false}) against a socket.io server that never defined '/nope' fired connect_error with e.message === 'Invalid namespace' and e.data undefined; 'connect' did not fire. Tested with socket.io and socket.io-client 4.8.4 on Node v22.23.3.
