DenoDDeno
Powered by
JonathanJ
Denoβ€’2y agoβ€’
3 replies
Jonathan

Setting up Deno 2.0 with Fresh and TypeORM

I am trying to setup my first deno project ever using Fresh and TypeORM. I have setup 2 files

A data.ts

import { DataSource } from "npm:typeorm";
import { User } from "../modules/auth/user.model.ts";

const dataSource = new DataSource({
    type: "mssql",
    url: Deno.env.get("DATABASE_URL"),
    entities: [User],
});

export default dataSource;
import { DataSource } from "npm:typeorm";
import { User } from "../modules/auth/user.model.ts";

const dataSource = new DataSource({
    type: "mssql",
    url: Deno.env.get("DATABASE_URL"),
    entities: [User],
});

export default dataSource;


And a
user.model.ts
user.model.ts


import { Column, Entity, PrimaryColumn } from "npm:typeorm";

@Entity({ name: "User" })
export class User {
    @PrimaryColumn()
    id: string;

    @Column()
    email: string;

}
import { Column, Entity, PrimaryColumn } from "npm:typeorm";

@Entity({ name: "User" })
export class User {
    @PrimaryColumn()
    id: string;

    @Column()
    email: string;

}


I am getting a few errors in the
user.model.ts
user.model.ts
, I am not sure if I am importing type orm correctly.

Unable to resolve signature of property decorator when called as an expression. 
Unable to resolve signature of property decorator when called as an expression. 



I am also not sure how to properly install the
mssql
mssql
properly for deno, do I do that in the deno.json? If so how?

And last, I am getting an error of an uncaught promise in Reflect.getMetadata.

How do I get around this?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno + TypeORM
Mayankk104MMayankk104 / help
17mo ago
Help setting up deno deploy github action for deno 2.0
DamienDDamien / help
2y ago
Routes with Deno and Fresh
BhauminBBhaumin / help
2y ago
Deno 2.0 TS errors on fresh project
Web BaeWWeb Bae / help
2y ago