After searching for a solution without any luck, I decided to start a new discussion on this topic.
Currently, I am working on azure functions using Typescript and encountering the following error:
import { Entity, BaseEntity, PrimaryColumn, Column, ManyToOne } from "typeorm";
SyntaxError: Cannot use import statement outside a module
Here is my tsconfig file:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"esModuleInterop": true,
"strict": true,
"lib": [
"esnext"
],
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
}
}
If anyone has any suggestions on how to resolve this issue, please let me know. Thank you!