Shopify/liquid · warning

Template.file_system=

Error message

Template.file_system=

What it means

Fires on the legacy class-level setter Template.file_system=, which is deprecated in favor of the instance-level Environment#file_system= API. It is not an error condition: the method unconditionally emits a deprecation warning via Deprecations.warn whenever any caller assigns a file system (e.g. a Liquid::CachingFileSystem or BlankFileSystem object used to resolve {% include %} templates) through this old class-level entry point, then forwards the assignment to Environment.default. Any code still configuring template loading globally on the Template class triggers this warning, signaling that the code should migrate to setting file_system on a Liquid::Environment instance instead.

Solutions

  1. Use Liquid::Environment.default.file_system = fs
  2. Better: build an Environment with the file_system and pass it to Template.parse(template, environment: env)

Example fix

// before
Liquid::Template.file_system = Liquid::LocalFileSystem.new('app/views', '%s.liquid')
// after
Liquid::Environment.default.file_system = Liquid::LocalFileSystem.new('app/views', '%s.liquid')
Defensive patterns

Strategy: validation

Validate before calling

fs = Liquid::LocalFileSystem.new(path, '%s.liquid')
Liquid::Environment.default.file_system = fs

Prevention

When it happens

Trigger: Calling Liquid::Template.file_system = Liquid::LocalFileSystem.new(...) in a Rails initializer or rake task.

Common situations: Apps loading partials from custom directories after upgrading Liquid; gems configuring Liquid globals at boot.

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


AI-assisted analysis of Shopify/liquid@807d45a6b3 (2026-09-08). Data as JSON: /api/errors/f13146fcf5b3b107. Report an issue: GitHub.

Appendix: source

Thrown at lib/liquid/template.rb:48

        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.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

View on GitHub (pinned to 807d45a6b3)