mongoose-patch-history icon indicating copy to clipboard operation
mongoose-patch-history copied to clipboard

mongoose 6.4.4 not work

Open hmz22 opened this issue 2 years ago • 4 comments

when use mongoose 6.4.4 show this error: also I make connection with createConnection and I pass mongoose: myConnection in option

schema = schema._clone(this.base.Schema);
                      ^
TypeError: schema._clone is not a function
    at NativeConnection.Connection.model (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\mongoose\lib\connection.js:1186:23)
    at createPatchModel (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\mongoose-patch-history\lib\index.js:343:27)
    at exports.default (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\mongoose-patch-history\lib\index.js:85:17)
    at Schema.plugin (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\mongoose\lib\schema.js:1738:3)
    at _buildSchema (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\@typegoose\typegoose\src\internal\schema.ts:162:13)
    at buildSchema (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\@typegoose\typegoose\src\typegoose.ts:167:21)
    at getModelForClass (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\@typegoose\typegoose\src\typegoose.ts:89:58)
    at src/services/member/member.model.ts (D:\Projects\Tests\node-ts-sample-decorator2\src\src\services\member\member.model.ts:95:39)
    at __require (D:\Projects\Tests\node-ts-sample-decorator2\src\index.ts:11:50)
    at src/services/member/member.resolver.ts (D:\Projects\Tests\node-ts-sample-decorator2\src\src\services\member\member.resolver.ts:27:24)
    at __require (D:\Projects\Tests\node-ts-sample-decorator2\src\index.ts:11:50)
    at Object.<anonymous> (D:\Projects\Tests\node-ts-sample-decorator2\src\import-glob:.\services\**\*.resolver.ts:2:34)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Module._compile (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\source-map-support\source-map-support.js:547:25)
    at Module.mod._compile (D:\Projects\Tests\node-ts-sample-decorator2\node_modules\esbuild-runner-plugins\src\hook.ts:25:22)
    at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

hmz22 avatar Aug 14 '22 08:08 hmz22

Yes, facing same issue. Did you find a fix for this.

mugilan-viewzen avatar Dec 26 '23 11:12 mugilan-viewzen

Any updates on this bug?

mugilan-viewzen avatar Jan 03 '24 08:01 mugilan-viewzen

Hey @mugilan-viewzen,

unfortunately I didn't get a response from @codepunkt yet that he would be able to release a new version. If he's not able to release a new version I don't see a point in fixing this bug.

Would it help you if I provide a fix for this even if it is unsure that the fix will get released?

Greetings

vinerich avatar Jan 04 '24 15:01 vinerich

Hi @vinerich,

Yes, it would be really helpful. We can use patch-package in applying these new changes.

Thank you very much.

mugilan-viewzen avatar Jan 04 '24 15:01 mugilan-viewzen