It seems like some package upgrade with mongoose or @types/mongoose is now causing new typescript errors from mongoose $push, $pull, $addToSet, and $each operators. For example:
await User.findByIdAndUpdate(request.user._id, {
$push: {
mediaList: { $each: mediaIDs },
},
});
Hovering over $each I can see:
Type 'string[]' is not assignable to type 'never'.ts(2322)
I'm getting this same problem with the other operators as well (type "whatever given type" is not assignable to type never). I suppose it could also have to do with webpack upgrading and ts-loader upgrades. I'm using:
"@types/mongoose": "^5.2.4",
"mongoose": "^5.2.4",
"ts-jest": "^21.2.4",
"ts-loader": "4.1.0",
"ts-node": "^3.2.0",
"tslint": "^5.11.0",
"typescript": "^3.1.6",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"