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
Add typesVersion
with minimum TypeScript version
#12529
Comments
@elszczepano what version of TypeScript? I'm able to run Maybe because your |
I have a similar issue as @elszczepano with typescript 4.3.4, node 14.19. Just wanted to add some context. I am on mongoose@6.5.2 and was trying to upgrade to latest. Tried to downgrade to 6.6.3 without success. I cannot even upgrade to 6.5.3. Getting a compilation error as well there on a single line. |
Even after fixing the tsconfig the issue still occurs in my case. Regarding the TS version, I use EDIT: |
I had exactly same problem with TS 4.6.4, had to upgrade to latest version and it went away. |
Duplicate of #12512 |
this should be changed with #12522, which was included in mongoose 6.6.5 |
@YooItsMaster did you already try clearing the node modules and re-installing? also are you sure you are using typescript 4.8 to compile? |
Oh although i had ts v4.8.4 installed it was still using v4.6.2 for compilation. That fixed it. Sry, Thank |
@AlexRMU from what i can tell, the current types ( Line 172 in 8ea0a44
|
I ran into the same issue. I had Typescript 4.8.4 installed globally but in a monorepo package.json there was 4.6.2, which needed to change to.
This is a really obscure requirement to find, Perhaps the Typescript minimum version could be placed README or similar to help distribute this info? |
It appears, if a
It would produce the following error using the package with a unsupported version. And the error message appears to be improvable.
References: |
query.d.ts
in versions above 6.6.3
typesVersion
with minimum TypeScript version
I have the same problem. Typescript version 4.8.3 |
Same issue node: 'v16.15.1' using "skipLibCheck": true, in typescript config or upgrading to latest version of typescript doesn't work for me |
@hxtree I'm not getting any error when running with a TypeScript version that isn't listed in
A sample Mongoose script compiles just fine with TypeScript 4.1. This looks to be expected behavior from TypeScript. For example, look at the following highlighted section in the TS docs you linked to. |
Prerequisites
Mongoose version
6.6.5
Node.js version
16.16.0
MongoDB server version
6.0.2 (not required)
Description
I've experienced an issue with mongoose above version
6.6.3
. When I try to build a project that uses mongoose in version6.6.4
or higher I receive:When I switched to
6.6.3
the issue does not occur. My TS config:As I briefly checked, the pointed places seem to be syntactically correct so the issue is a bit awkward for me. I'd be grateful for a hint if an issue is on my side.
Steps to Reproduce
Just run
tsc --build
for a project that usesmongoose
.Expected Behavior
The project is built correctly.
The text was updated successfully, but these errors were encountered: