{"record":{"id":"f13146fcf5b3b107","repo":"Shopify/liquid","slug":"template-file-system","errorCode":null,"errorMessage":"Template.file_system=","messagePattern":"Template\\.file_system=","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/liquid/template.rb","lineNumber":48,"sourceCode":"        Deprecations.warn(\"Template.error_mode=\", \"Environment#error_mode=\")\n        Environment.default.error_mode = mode\n      end\n\n      def error_mode\n        Environment.default.error_mode\n      end\n\n      def default_exception_renderer=(renderer)\n        Deprecations.warn(\"Template.default_exception_renderer=\", \"Environment#exception_renderer=\")\n        Environment.default.exception_renderer = renderer\n      end\n\n      def default_exception_renderer\n        Environment.default.exception_renderer\n      end\n\n      def file_system=(file_system)\n        Deprecations.warn(\"Template.file_system=\", \"Environment#file_system=\")\n        Environment.default.file_system = file_system\n      end\n\n      def file_system\n        Environment.default.file_system\n      end\n\n      def tags\n        Environment.default.tags\n      end\n\n      def register_tag(name, klass)\n        Deprecations.warn(\"Template.register_tag\", \"Environment#register_tag\")\n        Environment.default.register_tag(name, klass)\n      end\n\n      # Pass a module with filter methods which should be available\n      # to all liquid views. Good for registering the standard library","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/Shopify/liquid/blob/807d45a6b3d4568e64e86b375e3702df2c7c860c/lib/liquid/template.rb#L30-L66","documentation":"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.","triggerScenarios":"Calling Liquid::Template.file_system = Liquid::LocalFileSystem.new(...) in a Rails initializer or rake task.","commonSituations":"Apps loading partials from custom directories after upgrading Liquid; gems configuring Liquid globals at boot.","solutions":["Use Liquid::Environment.default.file_system = fs","Better: build an Environment with the file_system and pass it to Template.parse(template, environment: env)"],"exampleFix":"// before\nLiquid::Template.file_system = Liquid::LocalFileSystem.new('app/views', '%s.liquid')\n// after\nLiquid::Environment.default.file_system = Liquid::LocalFileSystem.new('app/views', '%s.liquid')","handlingStrategy":"validation","validationCode":"fs = Liquid::LocalFileSystem.new(path, '%s.liquid')\nLiquid::Environment.default.file_system = fs","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set file_system on Environment.build/Environment.default at boot","Never mutate Liquid::Template class-level configuration","Keep a single Liquid config module as the only place touching these APIs"],"tags":["ruby","liquid","deprecation","file-system"],"backgroundTag":"deprecated-api-usage","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"}