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

Expected async keyword in function export #543

Closed
aleclarson opened this issue Jul 8, 2020 · 3 comments · Fixed by #648
Closed

Expected async keyword in function export #543

aleclarson opened this issue Jul 8, 2020 · 3 comments · Fixed by #648

Comments

@aleclarson
Copy link
Contributor

Playground link

const a = {}

export default a

function b() {}
@benjdlambert
Copy link
Contributor

benjdlambert commented Aug 31, 2021

@alangpierce + @aleclarson so not sure what the cause of this is, but it looks like moving the export default a to the bottom seems to fix the error. Unfortunately we have this in one of our dependencies, so that fix isn't going to work for us, is there anything you could point us in the right direction for in terms of a fix and we can try and contribute it?

@benjdlambert
Copy link
Contributor

Hey @alangpierce so it looks like it's a small bug. A simple ; at the end of the export default a also seems to fix it. Maybe something to do with the parsing of export default and working out where the end is. We can try and have a look at fixing this.

@benjdlambert
Copy link
Contributor

Ping @alangpierce can we get a review and merge on the PR?

alangpierce pushed a commit that referenced this issue Oct 7, 2021
Use ContextualKeyword._async here to make sure that we check if it's an async function in default exports.

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

Successfully merging a pull request may close this issue.

2 participants