Open mman opened 1 year ago
SyntaxError: await is only valid in async functions and the top level bodies of modules
Which Node version are you running? await on top level is unflagged since Node 14.8.0.
SyntaxError: await is only valid in async functions and the top level bodies of modules
@mman I followed the migration guide and the directions worked for me. Your error seems to be related to how you are calling your async method. My updated code is here for reference: https://github.com/netreconlab/parse-hipaa/blob/89ccb02db7970ffd494a1dae907f9a660e117171/parse/index.js#L407-L409. I used the 6.0.0-alpha.21
image for testing my development servers, but it worked on 6.0.0-alpha.17
also.
As far as your first issue, I still used the old way as well...
@cbaker6 Looks like you are calling async
function from top-level without await, and in your async
function then await parse.start()
. I am calling await parse.start()
on the top level and that fails. Node 16.
SyntaxError: await is only valid in async functions and the top level bodies of modules
Which Node version are you running? await on top level is unflagged since Node 14.8.0.
@mtrezza This is happening for me on Node 16.
New Issue Checklist
Issue 1 Description
I am following the migration guide to Parse Server 6, and encountered couple of issues.
I have changed my code to use simpler initialisation:
https://github.com/parse-community/parse-server/blob/76c7a6fbd06693229c1906d68117713bc0a18d42/6.0.0.md?plain=1#L28
And I get the following error:
I still have to use the old method of
const ParseServer = require('parse-server').ParseServer;
to get the proper constructor.Issue 2 Description
Trying to start the parse server in async way via:
Produces the following error:
I have to use the following workaround to actually produce async context on top level of my
index.js
:Server