kkemple / graphql-auth

🔒 GraphQL authentication and authorization middleware
MIT License
278 stars 19 forks source link

library is distributed in raw JS State and generates error #13

Closed mschipperheyn closed 5 years ago

mschipperheyn commented 5 years ago

This library is distrbuted in uncompiled state and generates the following error when used:

node_modules/graphql-auth/index.js:1
(function (exports, require, module, __filename, __dirname) { export class ContextError extends Error {
                                                              ^^^^^^

SyntaxError: Unexpected token export
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)

Presumably this can be resolved by implementing

[`@babel/preset-env`, {
    modules: true,
    node: 'current'
}]

But it's generally not recommended to distribute libraries this way.

kkemple commented 5 years ago

It should have been compiled. It's fixed now!

kkemple commented 5 years ago

@mschipperheyn can you confirm it's working now?

kkemple commented 5 years ago

@mschipperheyn ??

mschipperheyn commented 5 years ago

Thanks! I will have a go