{"record":{"id":"559058c273f4bead","repo":"gatsbyjs/gatsby","slug":"you-have-frontmatter-declared-with-js-or","errorCode":null,"errorMessage":"You have frontmatter declared with \"---js\" or \"---javascript\" that is not parsed by default to mitigate a security risk (see https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw). If you require this feature it can be enabled by setting \"jsFrontmatterEngine: true\" in the plugin options of gatsby-transformer-remark.","messagePattern":"You have frontmatter declared with \"---js\" or \"---javascript\" that is not parsed by default to mitigate a security risk \\(see https://github\\.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw\\)\\. If you require this feature it can be enabled by setting \"jsFrontmatterEngine: true\" in the plugin options of gatsby-transformer-remark\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-transformer-remark/src/gatsby-node.js","lineNumber":45,"sourceCode":"      .description(\n        `Enable JS for https://github.com/jonschlinkert/gray-matter#optionsengines`\n      ),\n  }).custom(value => {\n    const { jsFrontmatterEngine, engines = {} } = value || {}\n\n    if (jsFrontmatterEngine) {\n      // show this warning only once in main process\n      if (!process.env.GATSBY_WORKER_ID) {\n        console.warn(\n          `JS frontmatter engine is enabled in gatsby-transformer-remark (via jsFrontmatterEngine: true). This can cause a security risk, see https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw. If you are not relying on this feature we strongly suggest disabling it via the \"jsFrontmatterEngine: false\" plugin option. If you rely on this feature make sure to properly secure or sanitize your content source.`\n        )\n      }\n      return value\n    }\n\n    const js = () => {\n      if (!warnedAboutJSFrontmatterEngine) {\n        console.warn(\n          `You have frontmatter declared with \"---js\" or \"---javascript\" that is not parsed by default to mitigate a security risk (see https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw). If you require this feature it can be enabled by setting \"jsFrontmatterEngine: true\" in the plugin options of gatsby-transformer-remark.`\n        )\n        warnedAboutJSFrontmatterEngine = true\n      }\n      // we still have to return a frontmatter, so we just stub it with empty object\n      return {}\n    }\n\n    return {\n      ...value,\n      engines: {\n        ...engines,\n        js,\n        javascript: js,\n      },\n    }\n  })\n}","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-transformer-remark/src/gatsby-node.js#L27-L63","documentation":"Error \"You have frontmatter declared with \"---js\" or \"---javascript\" that is not parsed by default to mitigate a security risk (see https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw). If you require this feature it can be enabled by setting \"jsFrontmatterEngine: true\" in the plugin options of gatsby-transformer-remark.\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-transformer-remark/src/gatsby-node.js:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the `---js`/`---javascript` frontmatter block to plain YAML `---` frontmatter if you don't need JS evaluation","If JS frontmatter is required, opt in explicitly with jsFrontmatterEngine: true and ensure the markdown source is trusted/sanitized (GHSA-7ch4-rr99-cqcw)","The affected field will simply be unparsed/skipped until the engine is enabled"],"exampleFix":null,"handlingStrategy":"validation","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"}