Dataviewjs can’t load json file in the .obsidian directory

Things I have tried

I’m trying to load a json file in the .obsidian directory .

What I’m trying to do

I use this js code :

const s = dv.io.normalize(“test.json”, “.obsidian/”);
dv.paragraph(s);

const jsonString = await dv.io.load(s);
dv.paragraph(jsonString);

This code work when test.json in other obsidian path, but can’t read anything in .obsidian directory .

I don’t know it’s the limitation of dataview, or my code is wrong. please tell me, thanks.

I did more experimenting and found that file names or directory names prefixed with “.” can’t be read.

OK, I used these codes for the reading file:
const jsonString = await app.vault.readRaw(“.obsidian/test.json”);

thanks anyway!

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.