graphql-community / koa-graphql

Create a GraphQL HTTP server with Koa.
MIT License
843 stars 61 forks source link

"regeneratorRuntime is not defined" #57

Closed leebenson closed 8 years ago

leebenson commented 8 years ago

with 5.3, I now get this:

general error:  ReferenceError: regeneratorRuntime is not defined
    at graphqlHTTP (/Users/dev/app/node_modules/koa-graphql/dist/index.js:41:10)
leebenson commented 8 years ago

re-opening -- seems to be a regression from 0.5.2+ (works fine in 0.5.1)

chentsulin commented 8 years ago

Oh, it should be introduced by babel 6. You can use babel-polyfill for a quick fix.

And we should fix it via babel-runtime

$ npm install --save-dev babel-plugin-transform-runtime
$ npm install --save babel-runtime
{
  "plugins": [
    ["transform-runtime", {
      "polyfill": false,
      "regenerator": true
    }]
  ]
}
chentsulin commented 8 years ago

@leebenson Released as v0.5.4: https://github.com/chentsulin/koa-graphql/releases/tag/v0.5.4