{"record":{"id":"1d51f4feb622041b","repo":"meteor/meteor","slug":"ejson-parse-argument-should-be-a-string","errorCode":null,"errorMessage":"EJSON.parse argument should be a string","messagePattern":"EJSON\\.parse argument should be a string","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/ejson/ejson.js","lineNumber":506,"sourceCode":"  let serialized;\n  const json = EJSON.toJSONValue(item);\n  if (options && (options.canonical || options.indent)) {\n    serialized = canonicalStringify(json, options);\n  } else {\n    serialized = JSON.stringify(json);\n  }\n  return serialized;\n});\n\n/**\n * @summary Parse a string into an EJSON value. Throws an error if the string\n *          is not valid EJSON.\n * @locus Anywhere\n * @param {String} str A string to parse into an EJSON value.\n */\nEJSON.parse = (item) => {\n  if (typeof item !== \"string\") {\n    throw new Error(\"EJSON.parse argument should be a string\");\n  }\n  return EJSON.fromJSONValue(JSON.parse(item));\n};\n\n/**\n * @summary Returns true if `x` is a buffer of binary data, as returned from\n *          [`EJSON.newBinary`](#ejson_new_binary).\n * @param {Object} x The variable to check.\n * @locus Anywhere\n */\nEJSON.isBinary = (obj) => {\n  return !!(\n    (typeof Uint8Array !== \"undefined\" && obj instanceof Uint8Array) ||\n    (obj && obj.$Uint8ArrayPolyfill)\n  );\n};\n\n/**","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/meteor/meteor/blob/5076d2f818d3cac01d0cf8312fa5b2332076a4fb/packages/ejson/ejson.js#L488-L524","documentation":"Error \"EJSON.parse argument should be a string\" thrown in meteor/meteor.","triggerScenarios":"Thrown when EJSON.parse is given a non-string argument.","commonSituations":"Passing an object, buffer, or undefined to EJSON.parse instead of a JSON string.","solutions":["Pass a JSON string to EJSON.parse.","If you already have an object, use it directly instead of parsing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5076d2f818d3cac01d0cf8312fa5b2332076a4fb","analyzedAt":"2026-08-13T03:27:40.142Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}