"Route not found" error

Hello.

I’m getting a “Route not found” error when trying to copy a file to the data folder. Any idea why that happens?

Here’s the function …

async function importPresets() {
  try {
    let datafolder = await fs.getDataFolder();
    let importfile = await fs.getFileForOpening({types: ["json"]});

    if(importfile) {
      await importfile.copyTo(datafolder, {overwrite:true});
      if(await loadPresetFile()) {
        document.getElementById("dropdown_presets").firstElementChild.innerHTML = "" ;
        presetArray.forEach(await function(presets) {
          document.getElementById("dropdown_presets").firstElementChild.innerHTML += "<sp-menu-item >" + presets.name + "</sp-menu-item>";
        });
        document.getElementById("dropdown_presets").selectedIndex = 0;
        await updateUI(0);
        return true;
      }
    }
  } catch(error) {
    return false;
  }
}