Form error message appears when I wait uploaded file link from 'startUpload' function

Hello to all! I am facing a problem: I have to make a request to my own server after submitting the form, and for that I need to submit the url of the uploaded file. When I make a request without the ‘$w(’# fileUpload’).StartUpload()’ function, everything is fine and I get a success message. But when I try to upload a file and wait for the promise to resolve with the file url, I get an error. The strange thing is that the developer console is clean and all requests have a status of 200. I want to get a success message in this case too. Below is my code that handles the submit form -

export async function onSubmitClick(event) {
	
 const uploadFile = async () => {
 	const uploadedFile = await $w('# fileUpload').startUpload();
 	const fileUrl = await getFileUrl(uploadedFile);
 	return fileUrl;
    }
 const firstName = $w('# firstName').value || ''
 const lastName = $w('# lastName').value || ''
 const company = $w('# company').value || ''
 const email = $w('# email').value || ''
 const description = $w('# description').value || ''
 const website = $w('# website').value || ''
 const amount = $w('# amount').value || 0
 const businessStarted = $w('# business').value || ''
 const targetIndustry = $w('# targetIndustry').value || ''
 const teamCountry = $w('# teamCountry').value || ''
 const lastMonthRevenue = $w('# lastMonthRevenue').value || ''
 const b2b = $w('# b2b').value || ''
 const legalEntityCountry = $w('# legalEntityCountry').value || ''
 const file = $w('# fileUpload');

 const url = 'APIurl';

 const data = {
 'company. amount': amount,
 'company. name': company,
 'company. email': email,
 'company. website': website,
 'company. fundId': 'fundId',
 'company. description': description,
 'persons. firstName': firstName, 
 'persons. lastName': lastName,
        businessStarted,
        targetIndustry,
        teamCountry,
        lastMonthRevenue,
        b2b,
        legalEntityCountry,
        fileUrl: file. value. length ? await uploadFile() : null
    };

 try {
        axios. post(url, data, { headers: {
 'X-Api-Key': 'APIkey'
        } });
    } catch(error) {
        console.log('ERROR: ', error);
    }
 
}