Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using ES2017/ES8 async/await terms on a function #149

Closed
CarbonCollins opened this issue Jan 18, 2018 · 3 comments
Closed

Error when using ES2017/ES8 async/await terms on a function #149

CarbonCollins opened this issue Jan 18, 2018 · 3 comments

Comments

@CarbonCollins
Copy link

Hi,

I'm getting an error when running jsdoc-to-markdown after I used an async with a function, code example:

async function sequentialPromiseFromArray(context, fn, elements) {
  const resultArr = [];
  for (let i = 0, iLength = elements.length; i < iLength; i += 1) {
    resultArr.push(await fn.call(context, elements[i]));
  }
  return resultArr;
}

Once i run the task of generating the docs i get this error (errors on the function token immediately following the async token)):

[06:58:25] JSDOC_ERROR: ERROR: Unable to parse {redacted}\GitHub\Public Modules\openraildata-referencedata-nodejs\lib\refData.js: Unexpected token function
    at Explain.verifyOutput ({redacted}\GitHub\Public Modules\openraildata-referencedata-nodejs\node_modules\jsdoc-api\lib\jsdoc-command.js:113:19)
    at ChildProcess.handle.on.code ({redacted}\GitHub\Public Modules\openraildata-referencedata-nodejs\node_modules\jsdoc-api\lib\explain.js:48:38)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
The terminal process terminated with exit code: 1

I did get the same error on ESLint however after enabling ES8 mode the error was cleared on ESLint, however the issue still remains on jsdoc-to-markdown. Is there a configuration or flag that i am missing or is this a valid issue?

I'm running Node v8.5.0 with npm 5.6.0 and yarn 1.3.2 if that helps anything :)

Thanks

@75lb
Copy link
Member

75lb commented Jan 18, 2018

Fixed and released in v4.0.0 👍

@75lb 75lb closed this as completed Jan 18, 2018
@CarbonCollins
Copy link
Author

will give it a go :)

@CarbonCollins
Copy link
Author

Thanks for the fix 👍

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

No branches or pull requests

2 participants