I am running into trouble between two angular-fullstack apps deployed on AWS via same setup and configuration.
It seems that socket.io-client/socket.io.js isn't served properly on one of them despite having same settings.
Seems like it's getting an error 400 (bad request) when trying to get socket.io.js and in turn, it's getting an "io not defined".
I've narrowed it down to this piece of code:
var socketio = require('socket.io')(server, {
serveClient: (config.env === 'production') ? false : true,
path: '/socket.io-client'
});
Seems like if I set serveClient to always be true, it will work because it's always serving to the client.
If this is the case, why do so many resources online set serveClient to false for production? It works for one app but not the other.
EDIT: just deployed on AWS with serveClient: true. Doesn't work. But apparently it works on my local.
EDIT 2: did an npm install
for the working app, now it's broken so maybe something is broken with packages.
EDIT 3: did a test on NODE_ENV=production
after a grunt build:dist
and same issue so it should be issue with one of the packages.