Shopify/liquid · warning
Template.default_resource_limits=
Error message
Template.default_resource_limits=
What it means
Liquid::Template.default_resource_limits= is a private deprecated setter; resource-limit defaults (render length/time, template nesting) now live on Liquid::Environment. The shim forwards to Environment#default_resource_limits= and emits a deprecation warning.
Solutions
- Set Liquid::Environment.default.default_resource_limits = limits
- Or configure resource_limits on the specific Environment used to parse/render untrusted templates
Example fix
// before
Liquid::Template.send(:default_resource_limits=, { render_length_limit: 100_000 })
// after
Liquid::Environment.default.default_resource_limits = { render_length_limit: 100_000 } Defensive patterns
Strategy: validation
Validate before calling
limits = { render_length_limit: 100_000, render_time_limit: 5 }
Liquid::Environment.default.default_resource_limits = limits Prevention
- Configure resource limits on the Environment used for untrusted templates
- Treat the Template-level setter as private/legacy and never call it with send
- Document resource-limit configuration in one place per application
When it happens
Trigger: Calling Liquid::Template.send(:default_resource_limits=, {...}) or older code that called the setter directly when it was public.
Common situations: Hardening untrusted-template rendering (memory/time caps) with pre-Environment Liquid configuration code.
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.default_exception_renderer=
AI-assisted analysis of Shopify/liquid@807d45a6b3 (2026-09-08).
Data as JSON: /api/errors/650632de400c6221.
Report an issue: GitHub.
Appendix: source
Thrown at lib/liquid/template.rb:73
def tags
Environment.default.tags
end
def register_tag(name, klass)
Deprecations.warn("Template.register_tag", "Environment#register_tag")
Environment.default.register_tag(name, klass)
end
# Pass a module with filter methods which should be available
# to all liquid views. Good for registering the standard library
def register_filter(mod)
Deprecations.warn("Template.register_filter", "Environment#register_filter")
Environment.default.register_filter(mod)
end
private def default_resource_limits=(limits)
Deprecations.warn("Template.default_resource_limits=", "Environment#default_resource_limits=")
Environment.default.default_resource_limits = limits
end
def default_resource_limits
Environment.default.default_resource_limits
end
# creates a new <tt>Template</tt> object from liquid source code
# To enable profiling, pass in <tt>profile: true</tt> as an option.
# See Liquid::Profiler for more information
def parse(source, options = {})
environment = options[:environment] || Environment.default
new(environment: environment).parse(source, options)
end
end
def initialize(environment: Environment.default)
@environment = environmentView on GitHub (pinned to 807d45a6b3)