nswbmw / N-club

使用 Koa + MongoDB + Redis 搭建论坛系统
517 stars 107 forks source link

refresh session error: Cannot read property 'done' of undefined #17

Open choukin opened 7 years ago

choukin commented 7 years ago
 koa-generic-session:session session id not exist, generate a new one +10s
  koa-route GET /signup matches /signup [] +5ms

  koa-generic-session:session new session and do not modified +4ms
  koa-generic-session:session refresh session error: Cannot read property 'done' of undefined +1ms
  xxx GET /signup 500 13ms -

  TypeError: Cannot read property 'done' of undefined
      at next (/work/learn/learnkoa/node_modules/co/index.js:98:14)
      at onFulfilled (/work/learn/learnkoa/node_modules/co/index.js:69:7)
      at /work/learn/learnkoa/node_modules/co/index.js:54:5
      at Object.co (/work/learn/learnkoa/node_modules/co/index.js:50:10)
      at Object.toPromise (/work/learn/learnkoa/node_modules/co/index.js:118:63)
      at next (/work/learn/learnkoa/node_modules/co/index.js:99:29)
      at onFulfilled (/work/learn/learnkoa/node_modules/co/index.js:69:7)
      at process._tickCallback (internal/process/next_tick.js:103:7)

  <-- GET /favicon.ico
  koa-generic-session:session session id not exist, generate a new one +176ms
  koa-generic-session:session new session and do not modified +6ms
  koa-generic-session:session refresh session error: Cannot read property 'done' of undefined +0ms
  xxx GET /favicon.ico 500 8ms -

  TypeError: Cannot read property 'done' of undefined
      at next (/work/learn/learnkoa/node_modules/co/index.js:98:14)
      at onFulfilled (/work/learn/learnkoa/node_modules/co/index.js:69:7)
      at /work/learn/learnkoa/node_modules/co/index.js:54:5
      at Object.co (/work/learn/learnkoa/node_modules/co/index.js:50:10)
      at Object.toPromise (/work/learn/learnkoa/node_modules/co/index.js:118:63)
      at next (/work/learn/learnkoa/node_modules/co/index.js:99:29)
      at onFulfilled (/work/learn/learnkoa/node_modules/co/index.js:69:7)
      at process._tickCallback (internal/process/next_tick.js:103:7)

mac 笔记本,启动后 访问http://localhost:3000/signup

就会报上面的问题,

@nswbmw

MidiGeek commented 7 years ago

在co的issues中已经提出过这个问题,把脚本从"start": "NODE_ENV=default DEBUG= node --harmony app",改为"start": "NODE_ENV=default DEBUG= node app",就好了。去掉--harmony参数

xiaoji201509 commented 7 years ago

请问你找到解决办法了吗