{"record":{"id":"d9c53d54ee23ec2c","repo":"ViewComponent/view_component","slug":"no-templates-for-component-match-the-request-detai","errorCode":null,"errorMessage":"No templates for COMPONENT match the request DETAIL.\n\nTo fix this issue, provide a suitable template.","messagePattern":"No templates for COMPONENT match the request DETAIL\\.\n\nTo fix this issue, provide a suitable template\\.","errorType":"exception","errorClass":"ViewComponent::MissingTemplateError","httpStatus":null,"severity":"error","filePath":"lib/view_component/compiler.rb","lineNumber":101,"sourceCode":"        template.compile_to_component\n      end\n\n      @component.silence_redefinition_of_method(:render_template_for)\n\n      if @templates.one?\n        template = @templates.first\n        safe_call = template.safe_method_name_call\n        @component.define_method(:render_template_for) do |_|\n          @current_template = template\n          instance_exec(&safe_call)\n        end\n      else\n        compiler = self\n        @component.define_method(:render_template_for) do |details|\n          if (@current_template = compiler.find_templates_for(details).first)\n            instance_exec(&@current_template.safe_method_name_call)\n          else\n            raise MissingTemplateError.new(self.class.name, details)\n          end\n        end\n      end\n    end\n\n    def template_errors\n      @_template_errors ||= begin\n        errors = []\n\n        errors << \"Couldn't find a template file or inline render method for #{@component}.\" if @templates.empty?\n\n        @templates\n          .map { |template| [template.variant, template.format] }\n          .tally\n          .select { |_, count| count > 1 }\n          .each do |tally|\n          variant, this_format = tally.first\n","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/ViewComponent/view_component/blob/9f22c36fa7d7b44098a8ed97472e3b4674ae420f/lib/view_component/compiler.rb#L83-L119","documentation":"Error \"No templates for COMPONENT match the request DETAIL.\n\nTo fix this issue, provide a suitable template.\" thrown in ViewComponent/view_component.","triggerScenarios":"Thrown at lib/view_component/compiler.rb:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a template matching the requested details: for variants add e.g. my_component.html+phone.erb, for formats add e.g. my_component.json.jbuilder, for locales add a locale-scoped template.","Check the request's variant/format/locale and rename the template file suffix so its variant, format, and locale match what is being requested."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9f22c36fa7d7b44098a8ed97472e3b4674ae420f","analyzedAt":"2026-08-23T10:20:47.008Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}