foliojs / fontkit

An advanced font engine for Node and the browser
1.45k stars 213 forks source link

Issues with fs #246

Closed gianluca-vedovato closed 2 years ago

gianluca-vedovato commented 3 years ago

I have issues with fs on my project when I try to use fontkit. I'm using Nuxt js and when I try to open a font in a watch property of a component using:

const fontkit = require('fontkit')
const font = fontkit.openSync(pathToMyFont)

I get __webpack_require__(...).readFileSync is not a function

I tried to use 'fontkit/base', import fontkit instead of require it, change nuxt.config with "fs": "empty" but the issue still persist. Any idea of how can I open my font?