-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Sub-schema Type Mismatch #9812
Comments
I tried compiling your script in a clean directory and it compiles without any errors. Please:
|
now, that I downgraded to mongoose v5.9.13, it is compiling fine, let me get back on this after again trying out in a clean directory, but P.S: I accidentally closed the issue |
@vkarpov15 as you suggested, in a fresh directory, I did this: Without
Compilation error:
With
Compilation error:
Here, in this line: |
To further help to reproduce this issue, here, I provide these files and a
The other files |
Try removing |
Here, I've tried that already, and has the same outcome, I've also tried it in the Docker environment and it throws the same error |
I took a closer look at this and managed to confirm the issue, looks like I needed to run just |
Thanks for the action, looking forward to the update |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Schema inside schema (sub-schema) type mismatch
If the current behavior is a bug, please provide the steps to reproduce.
There is a Schema referring to GeoLocation, as per mongoose documentation, this following
PointSchema.ts
file is createdand another file
LocationModel.ts
which uses thisPointsSchema.ts
is createdError at the marked line is:
My
tsconfig.json
file:What is the expected behavior?
Sub-schema should be included by adapting the type of the schema
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: v14.7.0
mongoose: 5.11.11
@types/mongoose: 5.10.3
MongoDB: Atlas (version 4.2.11)
This issue was not seen in mongoose v5.9.13, and is seen in v5.11.11 (on probable enforcement of #9717)
Please update the documentation as per the updates and please let me know what I am missing here
The text was updated successfully, but these errors were encountered: