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

Could not parse ... syntax error #85

Open
calebeby opened this issue Aug 15, 2017 · 5 comments
Open

Could not parse ... syntax error #85

calebeby opened this issue Aug 15, 2017 · 5 comments
Labels

Comments

@calebeby
Copy link

This module doesn't work with code that has async/await

const adapter = require('../adapters/github')
const remark = require('remark')

const remarkConfig = remark().use(require('foobar'))

const checkReadme = async repo => {
  const readme = await adapter.getReadme(repo)
  const results = await remarkConfig().process(readme)
  return results
}

module.exports = checkReadme
Could not parse checkers/readme.js. There is a syntax error in file
@siddharthkp
Copy link
Owner

Thanks!

I'll look into it.

If you want to take a shot at it,
auto-install uses detective and detective-es6 to parse code.

@calebeby
Copy link
Author

Hm. detective-es6 uses node-source-walk, which uses babylon. Babylon supports async/await. I'm not sure why this isn't working. A useful feature of auto-install would be to print the syntax error, rather than just saying that there is a syntax error.

@siddharthkp
Copy link
Owner

That's a great idea 👍

@calebeby
Copy link
Author

OK, I did some digging.

The error is coming from detective, not detective-es6. detective uses acorn instead of babylon, but acorn supports async/await as well

@Mrgaton
Copy link

Mrgaton commented Nov 8, 2023

i got the same issue

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

No branches or pull requests

3 participants