-3

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,

Raphael Lopes
  • 141
  • 2
  • 14
  • 1
    [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) -> [mcve] – Andreas Aug 20 '22 at 15:17
  • The title tells a different story then the body. Which error is the correct one? – Andreas Aug 20 '22 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... – Raphael Lopes Aug 20 '22 at 15:51

1 Answers1

1

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

{
"parserOptions": {
    "ecmaVersion": 2017 @see https://eslint.org/docs/latest/user-guide/configuring/language-options
}
Pingoo
  • 36
  • 2