A platform for community discussion. Free, open, simple.
DEV: Add useful error message for hbs register_asset (#19185)
David Taylorabe281378978
diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rbindex 0de0274f0ec..980f94889e0 100644--- a/lib/plugin/instance.rb+++ b/lib/plugin/instance.rb@@ -586,6 +586,13 @@ class Plugin::Instanceenddef register_asset(file, opts = nil)+ if file.end_with?(".hbs", ".handlebars")+ raise <<~ERROR+ [#{name}] Handlebars templates can no longer be included via `register_asset`.+ Any hbs files under `assets/javascripts` will be automatically compiled and included."+ ERROR+ end+if opts && opts == :vendored_core_pretty_textfull_path = DiscoursePluginRegistry.core_asset_for_name(file)else