From 786a95c666e50b23f4ce312c467a6bc4e2a54f7e Mon Sep 17 00:00:00 2001 From: Ostap Brehin Date: Tue, 13 Oct 2026 03:58:39 +0100 Subject: [PATCH] fix(padrino): avoid ActiveSupport's try --- vite_padrino/lib/vite_padrino/tag_helpers.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vite_padrino/lib/vite_padrino/tag_helpers.rb b/vite_padrino/lib/vite_padrino/tag_helpers.rb index 9910c463..0f6e3c0f 100644 --- a/vite_padrino/lib/vite_padrino/tag_helpers.rb +++ b/vite_padrino/lib/vite_padrino/tag_helpers.rb @@ -59,7 +59,9 @@ def vite_manifest def vite_preload_tag(*sources, crossorigin:) sources.map { |source| href = asset_path(source) - try(:request).try(:send_early_hints, "Link" => %(<#{href}>; rel=modulepreload; as=script; crossorigin=#{crossorigin})) + if respond_to?(:request) && request.respond_to?(:send_early_hints) + request.send_early_hints("Link" => %(<#{href}>; rel=modulepreload; as=script; crossorigin=#{crossorigin})) + end tag(:link, rel: "modulepreload", href: href, as: "script", crossorigin: crossorigin) }.join("\n").html_safe end