Ara Yeressian
02/03/2022, 7:17 PM{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
"reason": "ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
" at process.<anonymous> (file:///Users/ayeressian/personal/my-sst-app/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)",
" at process.emit (events.js:376:20)",
" at processPromiseRejections (internal/process/promises.js:245:33)",
" at processTicksAndRejections (internal/process/task_queues.js:96:32)"
]
}
Function
...
const api = new sst.Api(this, "Api", {
routes: {
"GET /": {
function: {
handler: "src/function/db.handler",
environment: {
DATABASE,
CLUSTER_ARN: cluster.clusterArn,
SECRET_ARN: cluster.secret!.secretArn,
},
bundle: {
esbuildConfig: {
plugins: "./esbuild-config.js",
},
nodeModules: ["typeorm", "typeorm-aurora-data-api-driver"],
},
permissions: [cluster],
},
},
},
});
tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true
},
"extends": "@tsconfig/node14",
"include": [
"stacks",
"src"
]
}
Any help would be appreciated.Adam Fanello
02/03/2022, 7:24 PM/* Experimental Options */
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
Adam Fanello
02/03/2022, 7:26 PMAra Yeressian
02/03/2022, 7:34 PM