Shopify/liquid · warning
Template.default_exception_renderer=
Error message
Template.default_exception_renderer=
What it means
Setting Liquid::Template.default_exception_renderer= is deprecated; global template defaults moved to Liquid::Environment, and this shim forwards to Environment#exception_renderer= while emitting a deprecation warning.
Solutions
- Set Liquid::Environment.default.exception_renderer = renderer
- Prefer building a dedicated Environment with its own exception_renderer and pass it to Template.parse
Example fix
// before
Liquid::Template.default_exception_renderer = ->(e) { e.message }
// after
Liquid::Environment.default.exception_renderer = ->(e) { e.message } Defensive patterns
Strategy: validation
Validate before calling
env = Liquid::Environment.default env.exception_renderer = renderer # configure via Environment, not Template
Prevention
- Centralize Liquid configuration in one initializer that only uses Environment
- Fail tests when any Liquid deprecation warning appears
- Avoid assigning to Template class-level setters in gems/engines
When it happens
Trigger: Calling Liquid::Template.default_exception_renderer = ->(e){ ... } in an initializer or test setup.
Common situations: Apps upgrading from Liquid 4-era global configuration; centralizers that render templates with custom error handling per environment.
Understand the failure class
Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.
Related errors
- Template.error_mode= is deprecated. Use…
- DEPRECATION WARNING: Condition#evaluate without a context…
- [DEPRECATION] # is deprecated. Use # instead. Called from #…
- :rigid is deprecated. Use :strict2 instead.
- Template.file_system=
AI-assisted analysis of Shopify/liquid@807d45a6b3 (2026-09-08).
Data as JSON: /api/errors/b757f95e6ccfb5c2.
Report an issue: GitHub.
Appendix: source
Thrown at lib/liquid/template.rb:39
attr_reader :profiler
class << self
# Sets how strict the parser should be.
# :lax acts like liquid 2.5 and silently ignores malformed tags in most cases.
# :warn is the default and will give deprecation warnings when invalid syntax is used.
# :strict enforces correct syntax for most tags
# :strict2 enforces correct syntax for all tags
def error_mode=(mode)
Deprecations.warn("Template.error_mode=", "Environment#error_mode=")
Environment.default.error_mode = mode
end
def error_mode
Environment.default.error_mode
end
def default_exception_renderer=(renderer)
Deprecations.warn("Template.default_exception_renderer=", "Environment#exception_renderer=")
Environment.default.exception_renderer = renderer
end
def default_exception_renderer
Environment.default.exception_renderer
end
def file_system=(file_system)
Deprecations.warn("Template.file_system=", "Environment#file_system=")
Environment.default.file_system = file_system
end
def file_system
Environment.default.file_system
end
def tags
Environment.default.tagsView on GitHub (pinned to 807d45a6b3)