- Issue created by @myriam_b
I don't know if it's your problem but Vite may uglify Drupal variable in your function, so you get a.t() in your uglified JS.
And Drupal.t() needs to remain Drupal.t() even uglified
https://drupal.stackexchange.com/a/284198/106294