wp enqueue script – The js & css plugin can not locate its own files, the great path of disorder

This is my last resort to ask everyone for help. I have a problem with some plugins installed. They can not locate their own js / CSS file and that is a big problem. Iv checked the console for errors and I'm over 30.

Also, something to mention my sites are powered by base rock / trellis.

Let me get to it. All js / css files are pretty much a great path like the one shown below.

Broken link:
https://test.com/wp/srv/www/test.com/current/web/app/plugins/jet-menu/cherry-framework/modules/cherry-handler/assets/css/cherry-handler-styles min.css? see = 1.5.10

What it should be:
https://test.com/app/plugins/jet-menu/cherry-framework/modules/cherry-handler/assets/css/cherry-handler-styles.min.css?ver=1.5.10

I have been experimenting with global $ wp_scripts; and enqueue_scripts but have not really found a way to modify / give the scripts new routes

I made a small script to get some information about the routes of the files, etc., the main thing here is to replace the old route with a new one without canceling the registration, and also wp_localize. But no luck

Keep in mind that this is not the complete code

add_action (& # 39; wp_enqueue_scripts & # 39 ;, [ $this, 'get_scripts'] );

// const rp_wp_path = & # 39; / wp ((?? app).) *) app / is & # 39 ;;
// const rp_srv_path = & # 39; / srv (((?! app).) *) app / is & # 39 ;;

public function get_scripts ()
{
global $ wp_scripts;

$ collected = [];

foreach ($ wp_scripts-> registered as $ key => $ script) {
// Return as matrix
$ script = (array) $ script;
// check if the current route has slug
if (strpos ($ script["src"], $ this-> plugin_slug)! == false) {
// check the current statu route (Skip working once)
if ($ this-> is_dead ($ script["src"])! == false) {
// Store old route
$ script["old_src"] = $ script["src"];
// Replace different broken routes with the correct path
$ file_url = preg_replace (self :: rp_wp_path, self :: rp_srv_end, $ script["src"]);
$ file_url = preg_replace (self :: rp_srv_path, self :: rp_srv_end, $ script["src"]);
// Add $ this-> base_url if necessary
if (strpos ($ file_url, $ this-> base_url) === false) {
$ file_url = $ this-> base_url. $ file_url;
}
// Replace old source with new
$ script["src"] = $ file_url;
// Append data to $ collected
$ collected[$script["handle"]]= $ script;
}
}

}

$ this-> formatData ($ this-> format, $ collected);
}

Data extracted with my script.

    ["ui-select"]=>
array (7) {
    ["handle"]=>
string (9) "ui-select"
    ["src"]=>
string (139) "https://test.com/app/plugins/jet-menu/cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/min/ui-select .min.js "
    ["deps"]=>
array (1) {
      [0]=>
string (6) "jquery"
}
    ["ver"]=>
chain (6) "1.5.10"
    ["args"]=>
NULL
    ["extra"]=>
array (1) {
      ["group"]=>
int (1)
}
    ["old_src"]=>
string (152) "/srv/www/test.com/current/web/app/plugins/jet-menu/cherry-framework/modules/cherry-ui-elements/inc/ui-elements/ui-select/assets/ min / ui-select.min.js "

Any suggestion? It's very urgent, I feel like I'm going to lose all my hair haha.