This is my tsconfig.json:
{
"compilerOptions": {
/* Docs: [https://www.typescriptlang.org/tsconfig](https://www.typescriptlang.org/tsconfig) */
"target": "ES2022",
"module": "ES2022",
"outDir": "bin",
"rootDir": "/",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"checkJs": true,
"allowJs": true,
"moduleResolution": "node",
"types": ["node", "mocha"],
"typeRoots": ["node_modules/@types"],
"lib": ["ES2022"],
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowUnreachableCode": true,
"useUnknownInCatchVariables": false // TypeScript 4.4+ only!
},
"ts-node": {
"esm": true,
"compilerOptions": {
"module": "nodenext"
}
},
"include": ["app/**/*.ts", "config/**/*.js", "test/**/*.ts"],
"exclude": ["node_modules", "<node_internals>/**", "./built/**/*"]
}
This is the error:
Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.ts(1378)