-2

I am working on a side project, using node and firebase.

I can create regular functions and cloud functions, but when I try to create an async one like this :

 async function getApartments(){...}

I have this error : "ESLint: Parsing error: Unexpected token function"

I saw on others posts (here) this can be linked to using Async functions on an old version of node, but since I'm on a recent version of node (17.8) I really don't understand the problem.

Thanks in advance,

3
  • 1
    How do I ask a good question? -> minimal reproducible example Commented Aug 20, 2022 at 15:17
  • The title tells a different story then the body. Which error is the correct one? Commented Aug 20, 2022 at 15:17
  • @Andreas I don't understand how the title tells a different error ? The error is about the function token, and I found it can be due to an async function on older versions, which is not my case, hence my question... Commented Aug 20, 2022 at 15:51

1 Answer 1

1

Good morning, Do you use eslint ? if yes ->

{
"parserOptions": {
    "ecmaVersion": 2017 @see https://eslint.org/docs/latest/user-guide/configuring/language-options
}
Sign up to request clarification or add additional context in comments.

1 Comment

Hello ! Yes I do. This that, had to add a few rules (missing jsdoc for example) but it worked like a charm. Thank you!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.