alabid / flylatex

FlyLatex: A Realtime Collaborative Environment (with a concurrent editor) in node-js.
766 stars 85 forks source link

Error: Must give hashtype string as argument. #51

Open garlofrank opened 9 years ago

garlofrank commented 9 years ago

Hi everyone.... thank in advance I do not know if this is a issue of flylatex or by another component. Can anybody help me?.

/home/testing/flylatex$ node app.js

info - socket.io started Express server listening on port 3002 in development mode Error: Must give hashtype string as argument at new Hash (crypto.js:188:19) at Object.Hash (crypto.js:187:12) at MongoStore.set (/home/testing/pruebanode/flylatex/node_modules/connect-mongo/lib/connect-mongo.js:256:30) at Session.save (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/middleware/session/session.js:83:25) at ServerResponse.res.end (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/middleware/session.js:280:21) at ServerResponse.res.send (/home/testing/pruebanode/flylatex/node_modules/express/lib/response.js:108:8) at ServerResponse.res._render (/home/testing/pruebanode/flylatex/node_modules/express/lib/view.js:442:10) at ServerResponse.res.render (/home/testing/pruebanode/flylatex/node_modules/express/lib/view.js:318:17) at ServerResponse.res._render (/home/testing/pruebanode/flylatex/node_modules/express/lib/view.js:432:10) at ServerResponse.res.render (/home/testing/pruebanode/flylatex/node_modules/express/lib/view.js:318:17) at exports.index (/home/testing/pruebanode/flylatex/routes_lib/index.js:37:9) at callbacks (/home/testing/pruebanode/flylatex/node_modules/express/lib/router/index.js:272:11) at exports.preIndex (/home/testing/pruebanode/flylatex/routes.js:93:5) at callbacks (/home/testing/pruebanode/flylatex/node_modules/express/lib/router/index.js:272:11) at param (/home/testing/pruebanode/flylatex/node_modules/express/lib/router/index.js:246:11) at pass (/home/testing/pruebanode/flylatex/node_modules/express/lib/router/index.js:253:5) at Router._dispatch (/home/testing/pruebanode/flylatex/node_modules/express/lib/router/index.js:280:5) at Object.Router.middleware as handle at next (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:204:15) at Object.session as handle at next (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:204:15) at Object.cookieParser as handle at next (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:204:15) at Object.methodOverride as handle at next (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:204:15) at Object.bodyParser as handle at next (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:204:15) at Object.handle (/home/testing/pruebanode/flylatex/node_modules/express/lib/http.js:83:5) at next (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:204:15) at HTTPServer.Server.handle (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/http.js:217:3) at Manager.handleRequest (/home/testing/pruebanode/flylatex/node_modules/socket.io/lib/manager.js:588:28) at HTTPServer. (/home/testing/pruebanode/flylatex/node_modules/socket.io/lib/manager.js:119:10) at HTTPServer.EventEmitter.emit (events.js:98:17) at HTTPParser.parser.onIncoming (http.js:2108:12) at HTTPParser.parserOnHeadersComplete as onHeadersComplete at Socket.socket.ondata (http.js:1966:22) at TCP.onread (net.js:525:27)

http.js:691 throw new Error('Can\'t set headers after they are sent.'); ^ Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (http.js:691:11) at ServerResponse.res.setHeader (/home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/patch.js:62:20) at /home/testing/pruebanode/flylatex/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js:72:19 at fs.js:266:14 at /usr/lib/nodejs/graceful-fs.js:94:5 at Object.oncomplete (fs.js:107:15)

philippmuller commented 9 years ago

+1

dearchap commented 9 years ago

I have tried this on 2 different machines and gotten the same error. Is it something with a newer version of express or some other framework ?

malcm commented 9 years ago

Any idea to solve this issue?

hgGeorg commented 9 years ago

Update connect-mongo to a newer version.

Magger commented 9 years ago

I have got the same problem.

Update connect-mongo to a newer version.

I tried to npm install connect-mongo and npm update connect-mongo but the problem remains. What shall I try next?

hgGeorg commented 9 years ago

Change the line

"connect-mongo" : "0.4.x"

to

"connect-mongo" : "*"

then run

npm update --save connect-mongo
Magger commented 9 years ago

Change the line "connect-mongo" : "0.4.x"

to "connect-mongo" : "*"

In which file?

Magger commented 9 years ago

I have changed the corresponding line in the packages.json file, updated the connect-mongo package and now it seems to work. Thanks.

lxidea commented 9 years ago

Solve my problem. Thanks.

tobiashochguertel commented 8 years ago

Thanks @hgGeorg Worked for me.