Could not load font.typeface.json

I tried to load json font file to three.js fontLoader but I got this error

Uncaught SyntaxError: Unexpected string in JSON at position 1
    at JSON.parse (<anonymous>)
    at Object.onLoad (FontLoader.js:34)
    at XMLHttpRequest.<anonymous> (three.module.js:38713)

and it is the case with every diffrent font.json I tried
and there is no errors inside the font file

most likely wrong path. what’s the path you used? it can’t start with ./ or …/

the path I used is : ‘./fonts/Debrosee-ALPnL-msdf.json’

the fonts folder and the Text.js in which the code above declaired are in the same directory
i removed the ./ but it still the same

that is not a valid path. the file either has to be in your public folder (and now the path has to start with “/”) or you need to import the file.

1 Like

I see, thank you very much it worked finally.

Open ‘Debrosee-ALPnL-msdf.json’ file in notepad and check what’s inside.

It should be something like this… I faced the same problem and found I have not saved the json file properly.