sails: socket.io.js - Failed to parse incoming socket.io request
Just tried to upgrade to sails 0.11. I followed the migration guide and used:
sails generate sails.io.js --force
But after running my project I get the following error on server:
Error (SAILS:HOOK:SOCKETS:PARSE_VIRTUAL_REQ):: Failed to parse incoming socket.io request
...
details: 'Sails v0.11.x is not compatible with the socket.io/sails.io.js client SDK version you are using (0.9.0). Please see the v0.11 migration guide on http://sailsjs.org for more information.'
I think it is something with minification of socket.io.js, because if I copy&paste actual version of socket.io.js in sails.io.js instead of minified code it’s working.
The problem is present on Mac Chrome or Safari but Firefox is ok.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 22 (7 by maintainers)
Ok i found the issue. For some reason the version is not available in the
SDK META DATAinformation. In the filenode_modules\sails\node_modules\sails-hook-sockets\lib\parse-sdk-metadata.jsthere is a code which checks if version is not available in the meta data then assume the version is0.9.0So i changed
0.9.0to0.11.0and voila! things are working.