Closed michelalbers closed 2 years ago
Found it ...
profilePayoutTransaction: {
type: mongoose.Schema.Types,
ref: "Transaction",
required: false,
},
needed to be
profilePayoutTransaction: {
type: mongoose.Schema.Types.ObjectId, // <-- .ObjectId was missing
ref: "Transaction",
required: false,
},
Do you want to request a feature or report a bug? bug
What is the current behavior? mongoose is listed as a peerDependency in my database package and as a dependency in my consuming api package. No duplicate versions of mongoose are present!
yarn list --pattern mongoose
only reveals version 6.2.0.When starting up the API I receive the error
TypeError: schema._preCompile is not a function
If the current behavior is a bug, please provide the steps to reproduce.
shared/database/model.ts
packages/api/updateModel.ts
shared/models/tsconfig.json
packages/api/tsconfig.json
What is the expected behavior? Should start up without errors
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version. Node: 14.15.4 Typescript: 4.5.5 Mongoose: 6.2.0
Output of
yarn list --pattern mongoose
: └─ mongoose@6.2.0No duplicate versions of mongoose are present.