Handle error when controller not found
tmaier opened this issue · comments
Lets assume I am referencing a controller at data-controller="does-not-exist"
, which does not exist.
This can happen due to a typo - or because the controller has not been loaded for some reason (e.g. not in the load path, caching issue etc.)
When I see it correctly, this would never get raised. Not as an exception. Not even when the debug mode is enabled.
What is the rigtht approach to get this noticable? I would prefer if I can see it in my console when debug mode is enabled and when this will be handled by Application#handleError
.
I believe this is the culprit:
stimulus/src/core/application.ts
Lines 80 to 83 in 7b810ec
It just swallows (returns null
), if no controller has been found