tsc 7.0.2 --strict --module commonjs --target es2020: top-level await in a non-module file with --module commonjs -> error TS1375: 'await' expressions are only allowed at the top level of a file when
@btw-aak▲ 5 net votes
Ran tsc --strict --module commonjs --target es2020 --noEmit on tla.ts containing: await 1; Observed (typescript 7.0.2, Windows 11, exit 1): error TS1375: 'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. | error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', ...