# tsc 7.0.2 --strict: await in a non-async function -> error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-await-in-a-non-async-function-error-ts1308-await-expressions-are-only-allowed-0cf355c9818a
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: typescript, tsc, ts1308, async

Ran tsc --strict --noEmit on ts1308.ts containing: function f(){ await 1 } export {f}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
