tj / co

The ultimate generator based flow-control goodness for nodejs (supports thunks, promises, etc)
MIT License
11.88k stars 793 forks source link

Does not work with node v6.5 #292

Closed bishtawi closed 8 years ago

bishtawi commented 8 years ago

Recently updated node to the latest v6.5 and my webapp fails with this stack trace:

TypeError: Cannot read property 'done' of undefined
      at next (/Users/dev/work/node_modules/co/index.js:98:14)
      at onFulfilled (/Users/dev/work/node_modules/co/index.js:69:7)
      at /Users/Stephen/dev/work/node_modules/co/index.js:54:5
      at Object.co (/Users/dev/work/node_modules/co/index.js:50:10)
      at next (/Users/dev/work/node_modules/co/index.js:99:29)
      at onFulfilled (/Users/dev/work/node_modules/co/index.js:69:7)

I am not sure if the source of the issue is really co or some other library as the stack trace does not extend past co. I am using the koa framework, if that matters. Code worked fine with node v6.4.

bishtawi commented 8 years ago

Ok, I started stripping out third party libs, middleware and large pieces of the app to see when the error would go away. I narrowed it down to koa-generic-session or koa-convert. Its most likely not a co issue.

bishtawi commented 8 years ago

We can probably close this issue.

targos commented 8 years ago

@bishtawi It's still worrying that something broke between Node.js v6.4 and v6.5. Can you please mention me if you find where the issue is ?

ahan commented 8 years ago

I got the same issue, at last, I found that it is the '--harmony' args cause the 'Cannot read property 'done' of undefined'

From old time, my deploy script was try to start the nodejs application with 'node --harmony path/to/app.js'

Now I remove the 'harmony' args, issue solved.

bishtawi commented 8 years ago

Yup, I eventually narrowed it down to the harmony flag as well.

kothari775 commented 7 years ago

I am facing same issue with node v6.9. please share if anyone knows solution.

bishtawi commented 7 years ago

@kothari775 Run node without the --harmony flag. You shouldnt be using it anymore.

kothari775 commented 7 years ago

@bishtawi Thanks a lot.