{"record":{"id":"2c045179a57184d3","repo":"gatsbyjs/gatsby","slug":"invalid-regex-object-propname","errorCode":null,"errorMessage":"Invalid RegEx: ${object[propName]}","messagePattern":"Invalid RegEx: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-remark-prismjs/src/replace-string-with-regexp.js","lineNumber":7,"sourceCode":"module.exports = function replaceStringWithRegex(object) {\n  Object.keys(object).forEach(propName => {\n    if (typeof object[propName] === `string`) {\n      try {\n        object[propName] = new RegExp(object[propName])\n      } catch (e) {\n        console.warn(`Invalid RegEx: `, object[propName])\n      }\n    }\n\n    if (\n      object[propName] instanceof Object &&\n      !(object[propName] instanceof Array)\n    ) {\n      object[propName] = replaceStringWithRegex(object[propName])\n    }\n  })\n\n  return object\n}\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-remark-prismjs/src/replace-string-with-regexp.js#L1-L21","documentation":"Option-normalization warning in gatsby-remark-prismjs's replaceStringWithRegex helper: a plugin option expected as a RegExp is a plain string, but constructing a RegExp from it threw (invalid pattern). The option keeps its raw string value, so that pattern simply never matches; recursion continues over nested option objects.","triggerScenarios":"Thrown at packages/gatsby-remark-prismjs/src/replace-string-with-regexp.js:7 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the invalid regex syntax in the option value"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}