Webtask + Sendgrid =编译失败?

通过webtask.io运行:

var sgMail = require("@sendgrid/mail"); module.exports = function(context, req, res) { res.writeHead(200, { 'Content-Type': 'text/html '}); res.end('<h1>Hello, world!</h1>'); }; 

结果在这个回应中:

 { "code": 400, "message": "Compilation failed: Unexpected token {", "error": "Unexpected token {", "stack": "SyntaxError: Unexpected token {\n at exports.runInThisContext (vm.js:53:16)\n at Module._compile (module.js:373:25)\n at Module._compile (/data/sandbox/lib/module.js:127:21)\n at Object.Module._extensions..js (module.js:416:10)\n at Module.load (module.js:343:32)\n at Function.Module._load (module.js:300:12)\n at WebtaskModule.require (/data/sandbox/lib/module.js:101:19)\n at require (/data/sandbox/lib/module.js:136:21)\n at Object.<anonymous> (/data/io/3bd979bebf074788b6849906721a8b06/webtask.js:2:14)\n at WebtaskModule.compileWebtask (/data/sandbox/lib/module.js:95:34)" } 

如果我注释掉@sendgrid/mail模块,一切运行良好。 (而且,是的,我已经将模块添加到web任务。)

是我,模块还是web任务?