{"record":{"id":"c0cb02b36bd48c7c","repo":"Automattic/mongoose","slug":"invalid-schema-configuration-could-not-determine","errorCode":null,"errorMessage":"Invalid schema configuration: Could not determine the embedded type for array `${path}`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.","messagePattern":"Invalid schema configuration: Could not determine the embedded type for array `(.+?)`\\. See https://mongoosejs\\.com/docs/guide\\.html#definition for more info on supported schema syntaxes\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/schema.js","lineNumber":1744,"sourceCode":"    if (cast) {\n      type = cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type)\n        ? cast[options.typeKey]\n        : cast;\n      if (Array.isArray(type)) {\n        return new MongooseTypes.Array(path, this.interpretAsType(path, type, options), obj, null, this);\n      }\n\n      name = typeof type === 'string'\n        ? type\n        : type.schemaName || utils.getFunctionName(type);\n\n      // For Jest 26+, see #10296\n      if (name === 'ClockDate') {\n        name = 'Date';\n      }\n\n      if (name === void 0) {\n        throw new TypeError('Invalid schema configuration: ' +\n          `Could not determine the embedded type for array \\`${path}\\`. ` +\n          'See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.');\n      }\n      if (!Object.hasOwn(MongooseTypes, name)) {\n        throw new TypeError('Invalid schema configuration: ' +\n          `\\`${name}\\` is not a valid type within the array \\`${path}\\`.` +\n          'See https://bit.ly/mongoose-schematypes for a list of valid schema types.');\n      }\n\n      if (name === 'Union' && typeof cast === 'object') {\n        cast.parentSchema = this;\n      }\n    }\n\n    return new MongooseTypes.Array(path, cast || MongooseTypes.Mixed, obj, options, this);\n  }\n\n  if (type?.instanceOfSchema) {","sourceCodeStart":1726,"sourceCodeEnd":1762,"githubUrl":"https://github.com/Automattic/mongoose/blob/49cdab01366679723b487ecb754b38570f783289/lib/schema.js#L1726-L1762","documentation":"Error \"Invalid schema configuration: Could not determine the embedded type for array `${path}`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.\" thrown in Automattic/mongoose.","triggerScenarios":"Thrown at lib/schema.js:1744 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49cdab01366679723b487ecb754b38570f783289","analyzedAt":"2026-08-21T22:54:00.882Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}