{"record":{"id":"c799372a0123a877","repo":"Automattic/mongoose","slug":"invalid-ref-at-path-path-got-util-inspect","errorCode":null,"errorMessage":"Invalid ref at path \"${path}\". Got ${util.inspect(ref, { depth: 0 })}","messagePattern":"Invalid ref at path \"(.+?)\"\\. Got (.+?)\\)\\}","errorType":"exception","errorClass":"MongooseError","httpStatus":null,"severity":"error","filePath":"lib/helpers/populate/validateRef.js","lineNumber":17,"sourceCode":"'use strict';\n\nconst MongooseError = require('../../error/mongooseError');\nconst util = require('util');\n\nmodule.exports = validateRef;\n\nfunction validateRef(ref, path) {\n  if (typeof ref === 'string') {\n    return;\n  }\n\n  if (typeof ref === 'function') {\n    return;\n  }\n\n  throw new MongooseError('Invalid ref at path \"' + path + '\". Got ' +\n    util.inspect(ref, { depth: 0 }));\n}\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/Automattic/mongoose/blob/49cdab01366679723b487ecb754b38570f783289/lib/helpers/populate/validateRef.js#L1-L20","documentation":"Error \"Invalid ref at path \"${path}\". Got ${util.inspect(ref, { depth: 0 })}\" thrown in Automattic/mongoose.","triggerScenarios":"Thrown at lib/helpers/populate/validateRef.js:17 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"}