So i’m trying to setup a mikroorm with postgresql, but I get this weird error on the type:
This is the code
import { MikroORM, Options} from "@mikro-orm/core";
import { _prod_ } from "./constants";
import { Post } from "./entities/Post";
const main = async () => {
const config: Options =
const orm = await MikroORM.init({
entities: [Post],
dbName: "readit",
type: "postgresql", <<-- having error here
debug: !_prod_,
});
const post = orm.em.create(Post, {title:'First post'})
}
main();
And I’m getting this error
Object literal may only specify known properties, and 'type' does not exist in type 'Options<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>'.
I’m trying to follow the documentation but the error just doesn’t make sense at all.
is this an issue with typescript?
I tried to some settings on the typescript but it’s not changing anything.
Since I’m not familiar with mikroorm postgrestql and typescript yet, I’ve tried adding some codes but no luck.
My tsconfig.json
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"skipLibCheck": true,
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"removeComments": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"baseUrl": "."
},
"exclude": ["node_modules"],
"include": ["./src/**/*.ts"]
}
Vinz Lorenz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.