{"record":{"id":"9c1f51ddad4e3b45","repo":"mjmlio/mjml","slug":"mjml-mj-include-tags-were-found-but-includes-are","errorCode":null,"errorMessage":"[MJML] mj-include tags were found but includes are disabled by default.\\n  Files: ${filesWithIgnoredIncludes.join(', ')}\\n  To enable includes, add --config.allowIncludes true to your command.\\n  See https://documentation.mjml.io/#mj-include for security notes.","messagePattern":"\\[MJML\\] mj-include tags were found but includes are disabled by default\\.\\\\n  Files: (.+?)\\\\n  To enable includes, add --config\\.allowIncludes true to your command\\.\\\\n  See https://documentation\\.mjml\\.io/#mj-include for security notes\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/mjml-cli/src/client.js","lineNumber":350,"sourceCode":"      // eslint-disable-next-line no-console\n      console.warn(\n        `[MJML] Some mj-include paths were denied because they are outside the allowed directories.\\n` +\n          `  Files: ${filesWithDeniedIncludes.join(', ')}\\n` +\n          `  Add the include directories to --config.includePath to allow them.\\n` +\n          `  See https://documentation.mjml.io/#mj-include for security notes.`,\n      )\n    }\n  }\n\n  // Warn when mj-include tags are present but includes are still ignored.\n  if (config.ignoreIncludes !== false) {\n    const MJ_INCLUDE_RE = /<mj-include\\b/i\n    const filesWithIgnoredIncludes = inputs\n      .filter((i) => i && i.mjml && MJ_INCLUDE_RE.test(i.mjml))\n      .map((i) => i.file)\n    if (filesWithIgnoredIncludes.length) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        `[MJML] mj-include tags were found but includes are disabled by default.\\n` +\n          `  Files: ${filesWithIgnoredIncludes.join(', ')}\\n` +\n          `  To enable includes, add --config.allowIncludes true to your command.\\n` +\n          `  See https://documentation.mjml.io/#mj-include for security notes.`,\n      )\n    }\n  }\n\n  failedStream.forEach(({ error, file }) => {\n    console.error(`${file ? `File: ${file}\\n` : null}${error}`) // eslint-disable-line no-console\n\n    if (config.stack) {\n      console.error(error.stack) // eslint-disable-line no-console\n    }\n  })\n\n  if (inputOpt === 'v') {\n    const isInvalid =","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/mjmlio/mjml/blob/6c01d35af5da14108b86bbf052232e99de7ca755/packages/mjml-cli/src/client.js#L332-L368","documentation":"By default MJML disables mj-include processing for security reasons. When the CLI detects <mj-include> tags in the source input but includes were not enabled, it warns that those tags were ignored (left unprocessed) and output will not contain the included content.","triggerScenarios":"Running the mjml CLI on a file whose source matches /<mj-include\\b/i without passing --config.allowIncludes true. No includePath check even runs; the includes are simply skipped.","commonSituations":"Upgrading MJML from a version where includes were on by default; copying templates that use mj-include into a build that never opted in; new team members unaware of the allowIncludes flag.","solutions":["Add --config.allowIncludes true to the mjml command to enable includes","Then configure --config.includePath with the directories that may be included (see the related denied-includes warning)","Or remove/replace the <mj-include> tags if includes are not wanted","Pin/lock team build scripts so the flag is not lost when commands are copied"],"exampleFix":"// before\nmjml email.mjml\n// after\nmjml email.mjml --config.allowIncludes true --config.includePath ./partials","handlingStrategy":"validation","validationCode":"const src = fs.readFileSync(input, 'utf8')\nif (/<mj-include\\b/i.test(src) && !allowIncludes) {\n  throw new Error('Input uses <mj-include>; run with --config.allowIncludes true')\n}","typeGuard":"const usesIncludes = (mjml) => typeof mjml === 'string' && /<mj-include\\b/i.test(mjml)","tryCatchPattern":null,"preventionTips":["Add --config.allowIncludes true wherever templates use mj-include","Pre-scan inputs with /<mj-include\\b/i before building","Standardize the CLI invocation in a shared build script","Note the flag in template-authoring guidelines"],"tags":["mjml","security","mj-include","cli","configuration"],"backgroundTag":"feature-disabled-by-default","analyzedSha":"6c01d35af5da14108b86bbf052232e99de7ca755","analyzedAt":"2026-09-02T21:31:03.649Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}