Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

SyntaxError: Unexpected token function #179

Open
LinusU opened this issue Oct 18, 2016 · 2 comments
Open

SyntaxError: Unexpected token function #179

LinusU opened this issue Oct 18, 2016 · 2 comments

Comments

@LinusU
Copy link

LinusU commented Oct 18, 2016

When trying to require mention-bot as a module, I'm getting the following error:

node_modules/mention-bot/mention-bot.js:18
async function downloadFileAsync(url: string, cookies: ?string): Promise<string> {
      ^^^^^^^^
SyntaxError: Unexpected token function
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (node_modules/mention-bot/run-mention-bot.js:12:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/linus/dooer/service-mention-bot/index.js:3:20)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

My code is currently only one line:

require('mention-bot')

I installed mention-bot with:

npm install --save mention-bot
@vjeux
Copy link
Contributor

vjeux commented Oct 25, 2016

Arg, looks like the transpilation step is broken before we publish to npm. @gyandeeps do you know why that would be?

@mspangdal
Copy link
Contributor

this effectively breaks the sample api usage, is there a workaround for using the api?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants