{"record":{"id":"5ffbb4da4e0358fc","repo":"Shopify/liquid","slug":"no-such-template-template-path","errorCode":null,"errorMessage":"No such template '#{template_path}'","messagePattern":"No such template '#(.+?)'","errorType":"exception","errorClass":"Liquid::FileSystemError","httpStatus":null,"severity":"error","filePath":"lib/liquid/file_system.rb","lineNumber":56,"sourceCode":"  # Default pattern is \"_%s.liquid\".\n  #\n  # Example:\n  #\n  #   file_system = Liquid::LocalFileSystem.new(\"/some/path\", \"%s.html\")\n  #\n  #   file_system.full_path(\"index\") # => \"/some/path/index.html\"\n  #\n  class LocalFileSystem\n    attr_accessor :root\n\n    def initialize(root, pattern = \"_%s.liquid\")\n      @root    = root\n      @pattern = pattern\n    end\n\n    def read_template_file(template_path)\n      full_path = full_path(template_path)\n      raise FileSystemError, \"No such template '#{template_path}'\" unless File.exist?(full_path)\n\n      File.read(full_path)\n    end\n\n    def full_path(template_path)\n      raise FileSystemError, \"Illegal template name '#{template_path}'\" unless %r{\\A[^./][a-zA-Z0-9_/]+\\z}.match?(template_path)\n\n      full_path = if template_path.include?('/')\n        File.join(root, File.dirname(template_path), @pattern % File.basename(template_path))\n      else\n        File.join(root, @pattern % template_path)\n      end\n\n      raise FileSystemError, \"Illegal template path '#{File.expand_path(full_path)}'\" unless File.expand_path(full_path).start_with?(File.expand_path(root))\n\n      full_path\n    end\n  end","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/Shopify/liquid/blob/807d45a6b3d4568e64e86b375e3702df2c7c860c/lib/liquid/file_system.rb#L38-L74","documentation":"LocalFileSystem#read_template_file raises Liquid::FileSystemError when the resolved template file does not exist on disk. The include/render name was syntactically valid and resolved to full_path, but File.exist? returned false.","triggerScenarios":"{% include 'missing_partial' %} or {% render 'x' %} where root/pattern expansion (e.g. templates/_missing_partial.liquid) points to a non-existent file.","commonSituations":"Typo in the partial name; partial deleted or renamed while templates still reference it; wrong root directory or pattern configured (e.g. '%s.liquid' vs '_%s.liquid'); deploying without the partial files.","solutions":["Create the missing template file at the resolved path or fix the name in the {% include %} tag.","Verify Liquid::Template.file_system root and pattern point at the directory containing your partials (note the underscore prefix convention).","Add the partials to your deploy/package artifacts.","Pre-check existence in code: File.exist?(fs.full_path(name)) before render, to fail gracefully."],"exampleFix":"// before\nLiquid::Template.file_system = Liquid::LocalFileSystem.new('app/views', '%s.liquid')\n{% include 'header' %}  # looks for app/views/_header.liquid -> missing\n// after\nmkdir -p app/views && echo '...' > app/views/_header.liquid","handlingStrategy":"validation","validationCode":"def partial_exists?(name)\n  fs = Liquid::Template.file_system\n  File.exist?(fs.full_path(name))\nrescue Liquid::FileSystemError\n  false\nend","typeGuard":null,"tryCatchPattern":"begin\n  tpl.render(ctx)\nrescue Liquid::FileSystemError => e\n  missing = e.message[/No such template '(.+)'/, 1]\n  error_reporter.notify(\"Missing liquid partial: #{missing}\")\n  render_placeholder\nend","preventionTips":["Keep partials in version control and deploy artifacts.","Verify root and pattern settings match your naming convention (leading underscore).","Add a boot/deploy check that scans templates for include names and asserts files exist.","Avoid renaming/deleting partials without grepping for references."],"tags":["ruby","liquid","file-not-found","include","file-system"],"backgroundTag":"file-not-found","analyzedSha":"807d45a6b3d4568e64e86b375e3702df2c7c860c","analyzedAt":"2026-09-08T11:31:38.917Z","contentChangedAt":"2026-09-08T11:31:38.917Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}