Error "Name not Resolved" when deployed to Electron
Recenlty I tried to run my nodejs app with Electron as a desktop application. When I run my app, it shows error from socket.io like this:
GET http://file/socket.io/?EIO=3&transport=polling&t=1433386618495-6 net::ERR_NAME_NOT_RESOLVED
It seems that Electron couldn't find socket.io's essential files. How to solve it?
Did you set an url when creating a socket? socket.io-client uses window.localtion if you don't set specific url.
var socket = io('http://localhost');
I created the socket like this:
var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); /* the socket */
where should I place the url (http://localhost) ?
I meant client side.
I tried localhost & localhost:3000 but still get the error
GET http://localhost/socket.io/?EIO=3&transport=polling&t=1433389768914-8 net::ERR_NAME_NOT_RESOLVED
GET http://localhost:3000/socket.io/?EIO=3&transport=polling&t=1433389768914-8 net::ERR_NAME_NOT_RESOLVED
I use express framework
OK, it's solved. It is because the server isn't running. When I start the server, it works.