{"record":{"id":"e403e82fe9e48128","repo":"Shopify/liquid","slug":"errors-syntax-render","errorCode":"errors.syntax.render","errorMessage":"options[:locale].t(\"errors.syntax.render\")","messagePattern":"options\\[:locale\\]\\.t\\(\"errors\\.syntax\\.render\"\\)","errorType":"exception","errorClass":"Liquid::SyntaxError","httpStatus":null,"severity":"error","filePath":"lib/liquid/tags/render.rb","lineNumber":119,"sourceCode":"        key = p.consume\n        p.consume(:colon)\n        @attributes[key] = safe_parse_expression(p)\n        p.consume?(:comma)\n      end\n\n      p.consume(:end_of_string)\n    end\n\n    def strict2_template_name(p)\n      p.consume(:string)\n    end\n\n    def strict_parse(markup)\n      lax_parse(markup)\n    end\n\n    def lax_parse(markup)\n      raise SyntaxError, options[:locale].t(\"errors.syntax.render\") unless markup =~ SYNTAX\n\n      template_name = Regexp.last_match(1)\n      with_or_for = Regexp.last_match(3)\n      variable_name = Regexp.last_match(4)\n\n      @alias_name = Regexp.last_match(6)\n      @variable_name_expr = variable_name ? parse_expression(variable_name) : nil\n      @template_name_expr = parse_expression(template_name)\n      @is_for_loop = (with_or_for == FOR)\n\n      @attributes = {}\n      markup.scan(TagAttributes) do |key, value|\n        @attributes[key] = parse_expression(value)\n      end\n    end\n\n    class ParseTreeVisitor < Liquid::ParseTreeVisitor\n      def children","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/Shopify/liquid/blob/807d45a6b3d4568e64e86b375e3702df2c7c860c/lib/liquid/tags/render.rb#L101-L137","documentation":"The {% render %} tag parser raises Liquid::SyntaxError when the tag's markup does not match its SYNTAX regex (a template name, optional with/for parameter, and optional alias). The message is fetched from the locale file under errors.syntax.render. It means Liquid could not interpret the arguments given to a render tag.","triggerScenarios":"A {% render %} tag whose markup fails the SYNTAX regexp: e.g. {% render %} with no template name, {% render 'x' with foo alias2 %} with a malformed alias, or unquoted/invalid expressions passed to strict_parse via strict_parse(markup).","commonSituations":"Typos in render tags inside themes; dynamically generated template tags where the template name ends up empty; copying for-loop style syntax ({% render item of items %}) that the tag grammar does not accept.","solutions":["Ensure the render tag includes a valid quoted template name: {% render 'template-name' %}.","Check the with/for clause syntax: {% render 'x' with obj as alias %} or {% render 'x' for list as alias %}.","Escape or remove Liquid-like text in templates that is not meant to be parsed.","Validate templates programmatically with Template.parse before deploying so the failing tag/line is reported early."],"exampleFix":"// before\n{% render products %}\n// after\n{% render 'products' %}","handlingStrategy":"validation","validationCode":"markup = \"'products' with collection as items\"\nraise Liquid::SyntaxError, 'invalid render tag' unless markup =~ Liquid::Render::SYNTAX","typeGuard":"def valid_render_markup?(markup)\n  markup.is_a?(String) && markup.match?(Liquid::Render::SYNTAX)\nend","tryCatchPattern":"begin\n  template = Liquid::Template.parse(source)\nrescue Liquid::SyntaxError => e\n  logger.error(\"Liquid syntax error: #{e.message}\")\n  raise\nend","preventionTips":["Lint templates with Template.parse in CI before deploy","Always quote the render template name","Keep alias/with/for clauses exactly per documented grammar"],"tags":["liquid","template-syntax","parse-error","render-tag"],"backgroundTag":"schema-validation-failed","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"}