json-comments icon indicating copy to clipboard operation
json-comments copied to clipboard

json-comments is not working with pomelo suitable.

Open xykong opened this issue 12 years ago • 3 comments

As I use json-comments in my pomelo project by just simply 'require('json-comments');' in the application entrance at the top of app.js, the application is down. Without json-comments my application runs OK. I have no time to trace what is wrong with this module now. Show just post it here. The log:

[2013-12-17 17:17:17.486] [ERROR] pomelo - [...\game-server\node_modules\pomelo\lib\server\server.js] fail to forward message:TypeError: Cannot read property 'msgRemote' of undefined at doForward (...\game-server\node_modules\pomelo\lib\server\server.js:336:39) at dispatch (...\game-server\node_modules\pomelo\lib\server\server.js:102:7) at next (...\game-server\node_modules\pomelo\lib\common\service\filterService.js:50:7) at Service.beforeFilter (...\game-server\node_modules\pomelo\lib\common\service\filterService.js:65:3) at beforeFilter (...\game-server\node_modules\pomelo\lib\server\server.js:247:8) at pro.globalHandle (...\game-server\node_modules\pomelo\lib\server\server.js:111:3) at Component.globalHandle (...\game-server\node_modules\pomelo\lib\components\server.js:74:15) at handleMessage (...\game-server\node_modules\pomelo\lib\components\connector.js:249:15) at null. (...\game-server\node_modules\pomelo\lib\components\connector.js:199:5) at EventEmitter.emit (events.js:95:17)

xykong avatar Dec 17 '13 09:12 xykong

I'm sorry to reply so late!

Could you show me your server.json?

numbcoder avatar Jan 10 '14 13:01 numbcoder

It will parse error if json file include chinaese string. chinaese string is disppaly "black" or "object"

taiguangyin avatar Mar 06 '14 02:03 taiguangyin

@taiguangyin Could you show your json file to me ? I have add some chinese string to test , but not fail!

This is my test json https://github.com/numbcoder/json-comments/blob/master/test/comments.json

run:

npm test

numbcoder avatar Mar 06 '14 02:03 numbcoder