Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

TypeError: Class constructor Typegoose cannot be invoked without 'new' #393

Closed
kdong007 opened this issue Sep 30, 2019 · 1 comment
Closed
Labels

Comments

@kdong007
Copy link

Versions

  • NodeJS: 10.15.3
  • Typegoose(NPM): 5.9.1
  • mongoose: 5.7.1

Code Example

simply copy-paste from README

class User extends Typegoose {
    @prop()
    name?: string;
}

const UserModel = new User().getModelForClass(User);

tsconfig:

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["es2015", "dom"],
    "outDir": "dist",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  },
  "include": ["src/"],
  "exclude": ["backup/"]
}

Do you know why it happenes?

no

@kdong007 kdong007 added the bug label Sep 30, 2019
@hasezoey
Copy link
Contributor

#391

otherwise, i dont see an issue with this, what is your typescript version?

@kdong007 kdong007 closed this as completed Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants