diff --git a/app/javascript/controllers/application_controller.ts b/app/javascript/controllers/application_controller.ts index 4070dbb03..ada9f6a78 100644 --- a/app/javascript/controllers/application_controller.ts +++ b/app/javascript/controllers/application_controller.ts @@ -65,7 +65,10 @@ export class ApplicationController extends Controller { FOCUS_EVENTS.includes(targetOrEventName) ); } else { - invariant(eventNameOrHandler == 'string', 'event name is required'); + invariant( + typeof eventNameOrHandler == 'string', + 'event name is required' + ); invariant(handler, 'handler is required'); this.onTarget(targetOrEventName, eventNameOrHandler, handler); }