Uncaught TypeError: e.lastIndexOf is not a function
at le (app.js:1:246341)
I’m sorry but what were you trying to accomplish using app.vault.createFolder()
(other than creating a folder ) and how ?
I mean, where did you tried to use this ?
I have created a small function that creates the path if it doesn’t exist. All I want to is to create a folder, but it gives this error. I am passing the path as argument.
To add more context, I am learning languages & use the same templates for every new language. So, I wrote a program that adds a copy of the files under a new folder. Before I create those files, I wanted to create the folder.
async function createPath(path) {
// path e.g: VaultName/Language/Japanese
await app.vault.createFolder(path);
}
One thing, paths are specified as relative paths inside the vault. So you don’t have to include the vault’s name in the path. But this alone doesn’t explain the error.
Do you mean just copying & pasting
app.vault.createFolder("Language/Japanese");
in the dev console throws that error? I mean, nothing more or nothing less, just copying & pasting. If so, does it also happen in the sandbox vault?
I opened another vault & it works fine. I will migrate to another vault & probably figure out what causes this. I initially thought that it was something with my code.
My guess is that some plugin you installed hooked a handler for file/folder creation event, and it contains some bug. So if you can find which plugin is causing the error, you don’t have to switch to another vault.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.