Secbone / koa-session2

Middleware for Koa2 to get/set session
MIT License
153 stars 30 forks source link

Please fix it #2

Closed und3fined closed 8 years ago

und3fined commented 8 years ago
node_modules/koa-session2/dist/index.js:125
            var ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(sid) {
                                        ^

ReferenceError: regeneratorRuntime is not defined
Secbone commented 8 years ago

@KuTi Do you use babel-polyfill?

rimmartin commented 8 years ago

Hi, I get this with v 1.0.4 and before with 1.0.3.

koa next and nodejs 6.2.0. Trying to set up with redis. Should I install Babel anyway?

rimmartin commented 8 years ago

Ah, I'm just not understanding this babel thing; looks like it has to do with yet another javascript spec layer

Which one are you using?

Secbone commented 8 years ago

@rimmartin koa next dependents babel ( async/await ), so you can use this middleware and koa next with babel-preset-2015 and babel-preset -stage-0 :)

rimmartin commented 8 years ago

Thank you,

I also tried

npm install --save-dev babel-preset-es2015-node6
npm install --save-dev babel-polyfill

which I thought might make it work with V8 in nodejs 6.2 better. Still get the error but it may be my environment yet. Adding the preset -stage-0 part. Nothing more needed from koa session2 :-) Thanks for working on koa v2

Secbone commented 8 years ago

:)

0cv commented 8 years ago

This forces us however to add the babelPolyfill even so it may not be required for the rest of the project. Eventually using the transform-runtime instead could be a more modular alternative.

Secbone commented 8 years ago

@Krisa Great! I will rebuilt it soon! thanks! 👍

0cv commented 8 years ago

great thanks!