Skip to content

fix: support mongoose v9 embeddedSchemaType instead of caster - #119

Open
loresclement wants to merge 1 commit into
SoftwareBrothers:masterfrom
loresclement:fix/mongoose-9-compat
Open

fix: support mongoose v9 embeddedSchemaType instead of caster#119
loresclement wants to merge 1 commit into
SoftwareBrothers:masterfrom
loresclement:fix/mongoose-9-compat

Conversation

@loresclement

Copy link
Copy Markdown

Mongoose v9 removed SchemaType.caster. This causes AdminJS to crash when handling arrays of subdocuments.
This PR adds backward-compatible support for both:

Mongoose <= 8 using caster

Mongoose 9+ using embeddedSchemaType / fallbacks

Fixes runtime error:
TypeError: Cannot destructure property 'instance' of 'this.mongoosePath.caster' as it is undefined

@MaxS713

MaxS713 commented Aug 8, 2026

Copy link
Copy Markdown

Can we merge and deploy this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants