arnog / react-mathlive

Example using the React bindings for Mathlive
19 stars 17 forks source link

nextjs : error - ./node_modules/react-math-view/dist/index.modern.js:1:0 Module not found: Package path ./dist/mathlive-fonts.css is not exported from package #12

Open montassar-vaionex opened 1 year ago

montassar-vaionex commented 1 year ago

error - ./node_modules/react-math-view/dist/index.modern.js:1:0 Module not found: Package path ./dist/mathlive-fonts.css is not exported from package

WildYellowfin commented 1 year ago

You need to copy the fonts (and sounds) to public/static, then pass the paths as attributes: `<math-field fonts-directory="/static/fonts" sounds-directory="/static/sounds"

`

Note that there is currently a bug in Mathlive where these arguments are not read if the read-only attribute is provided. In this case you should use mf.setOptions to change the fonts directory.