Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find name 'Omit'. with the latest versions being thrown #121

Closed
sebastiangug opened this issue Nov 12, 2019 · 5 comments
Closed

Cannot find name 'Omit'. with the latest versions being thrown #121

sebastiangug opened this issue Nov 12, 2019 · 5 comments
Labels
not a typegoose issue This is not a typegoose issue / This pr addresses something that shouldnt be in typegoose

Comments

@sebastiangug
Copy link

node_modules/@typegoose/typegoose/lib/types.d.ts:15:56 - error TS2304: Cannot find name 'Omit'.

15 export declare type DocumentType<T> = T extends Base ? Omit<mongoose.Document, '_id'> & T : mongoose.Document & T;

Versions:

    "mongoose": "^5.7.6",
    "@typegoose/typegoose": "^6.1.2"

Fails during build, I have reverted to 6.0.4 for now and all works fine.

@sebastiangug sebastiangug added the bug Something isn't working label Nov 12, 2019
@hasezoey
Copy link
Member

typescript version?

@sebastiangug
Copy link
Author

    "typescript": "3.4.3"

@hasezoey
Copy link
Member

hasezoey commented Nov 12, 2019

The Omit utility type got added in typescript 3.5

-> readme states "requirements: typescript 3.7+"

@hasezoey hasezoey added not a typegoose issue This is not a typegoose issue / This pr addresses something that shouldnt be in typegoose and removed bug Something isn't working labels Nov 12, 2019
@sebastiangug
Copy link
Author

sebastiangug commented Nov 12, 2019

Ahh, I remember now, I had this issue before with using Omit;

I can't upgrade typescript for now as I'm using it with Angular and Nestjs which don't support 3.5 yet.

I'll just keep using the 6.0.4 and should be fine

@hasezoey
Copy link
Member

as for nestjs: i got it to work without problems on typescript 3.7

as for angular: angular/angular-cli#16071 (comment) (quick google search, never really used angular)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a typegoose issue This is not a typegoose issue / This pr addresses something that shouldnt be in typegoose
Projects
None yet
Development

No branches or pull requests

2 participants