QuickAdd Macro not working

Can someone please find why the following code isnt working with QuickAdd Macro?

async function captureTask() {
    const tag = await quickAddApi.inputPrompt("tag");
    const taskName = await quickAddApi.inputPrompt("task name");
    const reminderDateTime = await quickAddApi.datePrompt("reminder date and time", "YYYY-MM-DD HH:mm");
    const dueDate = await quickAddApi.datePrompt("due date", "YYYY-MM-DD");
    const scheduledDate = await quickAddApi.datePrompt("scheduled date", "YYYY-MM-DD");
    const priority = await quickAddApi.suggester(["⏫", "🔼", "🔽", " "], ["High", "Medium", "Low", "None"]);

    let taskString = '';

    if (tag) {
        taskString += `#${tag} `;
    }

    if (taskName) {
        taskString += `${taskName} `;
    }

    if (reminderDateTime) {
        taskString += `⏰ ${reminderDateTime} `;
    }

    if (dueDate) {
        taskString += `📅 ${dueDate} `;
    }

    if (scheduledDate) {
        taskString += `⏳ ${scheduledDate} `;
    }

    if (priority && priority !== " ") {
        taskString += `${priority}`;
    }

    return taskString.trim();
}

const taskString = await captureTask();
if (taskString) {
    await quickAddApi.addToDailyNote(taskString);
}

When runnig the Macro nothing happens