Capacitor doesn’t work for Ionic with vanilla JS

When creating Ionic app following documentation https://ionicframework.com/docs/vue/quickstart and converting typescript to javascript (10 steps on this doc page), then there is a problem creating android version by running this command: ionic cap add android

This command should create android folder, but i get this error message:

enter image description here

This error doesn’t exist if application is set for typescript, it appears only after converting to javascript.

Seems this is an internal issue with capacitor. Is there a way to fix this via vite.config or something similar?

By the way it’s Ionic version 7