Automattic / mongoose

MongoDB object modeling designed to work in an asynchronous environment.
https://mongoosejs.com
MIT License
26.96k stars 3.84k forks source link

mongoose not type compatible with typegoose #6180

Closed nhhockeyplayer closed 6 years ago

nhhockeyplayer commented 6 years ago

C:\apache-tomcat-9.0.0.M17\webapps\ROOT\api>ng build Date: 2018-02-28T02:16:28.684Z Hash: 1b199f24e7166644ffc8 Time: 10187ms chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 3.89 kB [entry] [rendered] chunk {main} main.bundle.js, main.bundle.js.map (main) 277 bytes [initial] [rendered] chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 297 bytes [initial] [rendered] chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 63.5 kB [initial] [rendered]

ERROR in node_modules/@types/mongoose/index.d.ts(57,9): error TS2300: Duplicate identifier 'NativeBuffer'. node_modules/@types/mongoose/index.d.ts(58,9): error TS2300: Duplicate identifier 'NativeDate'. node_modules/@types/mongoose/index.d.ts(59,9): error TS2300: Duplicate identifier 'NativeError'. node_modules/@types/mongoose/index.d.ts(67,14): error TS2300: Duplicate identifier 'Mongoose'. node_modules/@types/mongoose/index.d.ts(68,8): error TS2300: Duplicate identifier 'Mongoose'. node_modules/@types/mongoose/index.d.ts(147,9): error TS2300: Duplicate identifier 'CastError'. node_modules/@types/mongoose/index.d.ts(168,18): error TS2300: Duplicate identifier 'ConnectionBase'. node_modules/@types/mongoose/index.d.ts(396,9): error TS2300: Duplicate identifier 'Connection'. node_modules/@types/mongoose/index.d.ts(412,9): error TS2300: Duplicate identifier 'ValidationError'. node_modules/@types/mongoose/index.d.ts(421,9): error TS2300: Duplicate identifier 'Error'. node_modules/@types/mongoose/index.d.ts(511,9): error TS2300: Duplicate identifier 'VirtualType'. node_modules/@types/mongoose/index.d.ts(528,9): error TS2300: Duplicate identifier 'Schema'. node_modules/@types/mongoose/index.d.ts(951,13): error TS2300: Duplicate identifier 'MongooseDocument'. node_modules/@types/mongoose/index.d.ts(952,9): error TS2300: Duplicate identifier 'MongooseDocument'. node_modules/@types/mongoose/index.d.ts(1154,11): error TS2300: Duplicate identifier 'Subdocument'. node_modules/@types/mongoose/index.d.ts(1170,11): error TS2300: Duplicate identifier 'Array'. node_modules/@types/mongoose/index.d.ts(1279,11): error TS2300: Duplicate identifier 'DocumentArray'. node_modules/@types/mongoose/index.d.ts(1308,11): error TS2300: Duplicate identifier 'Buffer'. node_modules/@types/mongoose/index.d.ts(1340,10): error TS2300: Duplicate identifier 'ObjectIdConstructor'. node_modules/@types/mongoose/index.d.ts(1348,11): error TS2300: Duplicate identifier 'Decimal128'. node_modules/@types/mongoose/index.d.ts(1354,11): error TS2300: Duplicate identifier 'Embedded'. node_modules/@types/mongoose/index.d.ts(1394,9): error TS2300: Duplicate identifier 'Query'. node_modules/@types/mongoose/index.d.ts(1395,9): error TS2300: Duplicate identifier 'DocumentQuery'. node_modules/@types/mongoose/index.d.ts(1824,9): error TS2300: Duplicate identifier 'mquery'. node_modules/@types/mongoose/index.d.ts(1876,13): error TS2300: Duplicate identifier 'Schema'. node_modules/@types/mongoose/index.d.ts(2124,9): error TS2300: Duplicate identifier 'Aggregate'. node_modules/@types/mongoose/index.d.ts(2281,9): error TS2300: Duplicate identifier 'SchemaType'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(87,9): error TS2300: Duplicate identifier 'NativeBuffer'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(88,9): error TS2300: Duplicate identifier 'NativeDate'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(89,9): error TS2300: Duplicate identifier 'NativeError'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(97,14): error TS2300: Duplicate identifier 'Mongoose'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(98,8): error TS2300: Duplicate identifier 'Mongoose'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(196,9): error TS2300: Duplicate identifier 'CastError'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(260,18): error TS2300: Duplicate identifier 'ConnectionBase'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(479,9): error TS2300: Duplicate identifier 'Connection'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(495,9): error TS2300: Duplicate identifier 'ValidationError'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(504,9): error TS2300: Duplicate identifier 'Error'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(594,9): error TS2300: Duplicate identifier 'VirtualType'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(611,9): error TS2300: Duplicate identifier 'Schema'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(809,5): error TS2403: Subsequent variable declarations must have the same type. Variable 's trict' must be of type 'boolean | "throw"', but here has type 'boolean'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(811,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't oJSON' must be of type 'DocumentToObjectOptions', but here has type 'any'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(813,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't oObject' must be of type 'DocumentToObjectOptions', but here has type 'any'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(837,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't imestamps' must be of type 'boolean | SchemaTimestampsConfig', but here has type 'any'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(844,5): error TS2374: Duplicate string index signature. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(922,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v alidate' must be of type 'RegExp | [RegExp, string] | ValidateFn | [ValidateFn, string] | ValidateOpts | ValidateOpts...', but here has type 'any'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(972,5): error TS2374: Duplicate string index signature. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(990,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'v alidator' must be of type 'RegExp | ValidateFn', but here has type 'Function | RegExp'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1013,13): error TS2300: Duplicate identifier 'MongooseDocument'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1014,9): error TS2300: Duplicate identifier 'MongooseDocument'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1220,11): error TS2300: Duplicate identifier 'Subdocument'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1236,11): error TS2300: Duplicate identifier 'Array'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1345,11): error TS2300: Duplicate identifier 'DocumentArray'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1374,11): error TS2300: Duplicate identifier 'Buffer'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1406,10): error TS2300: Duplicate identifier 'ObjectIdConstructor'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1414,11): error TS2300: Duplicate identifier 'Decimal128'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1420,11): error TS2300: Duplicate identifier 'Embedded'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1460,9): error TS2300: Duplicate identifier 'Query'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1461,9): error TS2300: Duplicate identifier 'DocumentQuery'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1884,9): error TS2300: Duplicate identifier 'mquery'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(1936,13): error TS2300: Duplicate identifier 'Schema'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(2184,9): error TS2300: Duplicate identifier 'Aggregate'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(2319,9): error TS2300: Duplicate identifier 'SchemaType'. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(2722,5): error TS2374: Duplicate string index signature. node_modules/typegoose/node_modules/@types/mongoose/index.d.ts(2829,5): error TS2374: Duplicate string index signature. src/server/user.router.ts(41,31): error TS2304: Cannot find name 'UserModel'. src/server/user.routes.ts(11,11): error TS2345: Argument of type '(response: any) => void' is not assignable to parameter of type '() => void | PromiseLike

'.
nhhockeyplayer commented 6 years ago

{ "name": "api", "version": "1.0.0", "license": "CC0-1.0", "scripts": { "ng": "ng", "client": "ng serve --no-delete-output-path", "server": "./node_modules/.bin/ts-node ./server/server.ts --proxy-config ./proxy.json", "build": "ng build", "build-prod": "ng build --output-path=dist/ --target=production --environment=prod", "build-dev": "ng build --output-path=dist/ --target=development --environment=dev", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "postinstall": "ng build --aot -prod", "build-server": "tslint --project . && tsc", "watch-server": "cross-env NODE_ENV=development nodemon --watch 'server/*/' -e ts,tsx --exec 'ts-node' ./server/server.ts" }, "dependencies": { "@angular/animations": "5.2.6", "@angular/cdk": "5.2.3", "@angular/common": "5.2.6", "@angular/compiler": "5.2.6", "@angular/core": "5.2.6", "@angular/forms": "5.2.6", "@angular/http": "5.2.6", "@angular/material": "5.2.3", "@angular/platform-browser": "5.2.6", "@angular/platform-browser-dynamic": "5.2.6", "@angular/router": "5.2.6", "@ngrx/store-devtools": "5.1.0", "bcrypt": "1.0.3", "config": "1.30.0", "core-js": "2.5.3", "hammerjs": "2.0.8", "http-status-codes": "1.3.0", "koa": "2.5.0", "koa-bodyparser": "4.2.0", "koa-json": "2.0.2", "koa-mongoose": "2.0.0", "koa-passport": "4.0.1", "koa-router": "7.4.0", "koa-session": "5.8.1", "koa-static": "4.0.2", "koa2-cors": "2.0.5", "mongoose": "5.0.7", "mongoose-beautiful-unique-validation": "7.1.1", "rxjs": "5.5.6", "socket.io": "2.0.4", "typegoose": "3.9.0", "zone.js": "0.8.20" }, "devDependencies": { "@angular/cli": "1.7.1", "@angular/compiler-cli": "5.2.6", "@angular/language-service": "5.2.6", "@types/bcrypt": "1.0.0", "@types/bluebird": "3.5.20", "@types/config": "0.0.34", "@types/debug": "0.0.30", "@types/http-status-codes": "1.2.0", "@types/jasmine": "2.8.6", "@types/jasminewd2": "2.0.3", "@types/koa": "2.0.44", "@types/koa-bodyparser": "4.2.0", "@types/koa-passport": "4.0.1", "@types/koa-router": "7.0.27", "@types/koa-session": "5.7.1", "@types/koa-static": "4.0.0", "@types/koa2-cors": "2.0.1", "@types/lodash": "4.14.104", "@types/mongodb": "3.0.5", "@types/mongoose": "5.0.3", "@types/node": "9.4.6", "@types/passport-jwt": "3.0.1", "@types/passport-local": "1.0.32", "@types/socket.io-client": "1.4.32", "codelyzer": "4.1.0", "copy-webpack-plugin": "4.4.2", "cross-env": "5.1.3", "jasmine-core": "3.0.0", "jasmine-spec-reporter": "4.2.1", "karma": "2.0.0", "karma-chrome-launcher": "2.2.0", "karma-coverage-istanbul-reporter": "1.4.1", "karma-jasmine": "1.1.1", "karma-jasmine-html-reporter": "0.2.2", "nodemon": "1.17.1", "protractor": "5.3.0", "ts-node": "5.0.0", "tslint": "5.9.1", "typescript": "2.6.2" } }

vkarpov15 commented 6 years ago

Please report this on the typegoose repo. I wouldn't know how to even start debugging this.