{"record":{"id":"5334dbe38715a32d","repo":"ViewComponent/view_component","slug":"warning-the-self-class-component-s-around-rend","errorCode":null,"errorMessage":"WARNING: The #{self.class} component's around_render returned an HTML-unsafe string. The output will be automatically escaped, but you may want to investigate.","messagePattern":"WARNING: The #(.+?) component's around_render returned an HTML-unsafe string\\. The output will be automatically escaped, but you may want to investigate\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/view_component/base.rb","lineNumber":462,"sourceCode":"        html_escape(text)\n      end\n    end\n\n    def __vc_safe_output_preamble\n      __vc_maybe_escape_html(output_preamble) do\n        Kernel.warn(\"WARNING: The #{self.class} component was provided an HTML-unsafe preamble. The preamble will be automatically escaped, but you may want to investigate.\")\n      end\n    end\n\n    def __vc_safe_output_postamble\n      __vc_maybe_escape_html(output_postamble) do\n        Kernel.warn(\"WARNING: The #{self.class} component was provided an HTML-unsafe postamble. The postamble will be automatically escaped, but you may want to investigate.\")\n      end\n    end\n\n    def __vc_safe_around_render_output(output)\n      __vc_maybe_escape_html(output) do\n        Kernel.warn(\"WARNING: The #{self.class} component's around_render returned an HTML-unsafe string. The output will be automatically escaped, but you may want to investigate.\")\n      end\n    end\n\n    # Resets every render-scoped instance variable derived from the calling view\n    # context so a reused instance cannot leak controller/helper/request/format\n    # state from a previous render. Slot state (`@__vc_set_slots`,\n    # `@__vc_content_set_by_with_content`) is intentionally preserved because it\n    # is populated by callers _before_ `render_in` runs (e.g. via `with_*`\n    # slot setters or `with_content`).\n    RENDER_STATE_IVARS = %i[\n      @__vc_controller\n      @__vc_helpers\n      @__vc_request\n    ].freeze\n\n    def __vc_reset_render_state!\n      RENDER_STATE_IVARS.each do |ivar|\n        remove_instance_variable(ivar) if instance_variable_defined?(ivar)","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/ViewComponent/view_component/blob/9f22c36fa7d7b44098a8ed97472e3b4674ae420f/lib/view_component/base.rb#L444-L480","documentation":"Error \"WARNING: The #{self.class} component's around_render returned an HTML-unsafe string. The output will be automatically escaped, but you may want to investigate.\" thrown in ViewComponent/view_component.","triggerScenarios":"Thrown at lib/view_component/base.rb:462 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["In `around_render`, escape untrusted interpolations with `ERB::Util.html_escape` (or `h`) and mark the final trusted string `.html_safe` before returning it.","Alternatively build the output with `content_tag` or `safe_join` so escaping is handled for you."],"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"}