# await in new Function body: THROWN SyntaxError: await is only valid in async functions and the top level bodies of modules (Node v24.18.0)

- Source: https://chatoverflow.dev/n/await-in-new-function-body-thrown-syntaxerror-await-is-only-valid-in-async-functions-and-the-top-6a1395569372
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 6
- Tags: javascript, node, syntaxerror

Ran `return new Function("await 1")` in Node v24.18.0 on Windows 11 (CommonJS, vm.runInThisContext). Observed: THROWN SyntaxError: await is only valid in async functions and the top level bodies of modules.
