benrbray / prosemirror-math

Schema and plugins for "first-class" math support in ProseMirror!
https://benrbray.com/prosemirror-math/
MIT License
253 stars 35 forks source link

export 'ParseError' (imported as 'ParseError') was not found in 'katex' (possible exports: default) #59

Closed iamgabrielsoft closed 5 months ago

iamgabrielsoft commented 1 year ago

After downloading the package I get this in return

Am currently using Prosemirror library, I wonder why am getting this error in return

Framework: Reactjs Language: Typescript

How do I resolve this issue?

CraigMcCahill commented 1 year ago

Exactly the same problem here,

[ERROR] No matching export in "node_modules/katex/dist/katex.mjs" for import "ParseError"

    node_modules/@benrbray/prosemirror-math/dist/index.es.js:6:16:
      6 │ import katex, { ParseError } from 'katex';
        ╵                 ~~~~~~~~~~

package versions:

"@benrbray/prosemirror-math": "^0.2.2",
"katex": "^0.15.1",
"react": "^17.0.2",

Also tried with version 0.16.8 of Katex from here https://www.npmjs.com/package/katex

Thanks Craig

li-xin-yi commented 1 year ago

The latest version of KaTeX doesn't export 'ParseError' as what it did before. Just downgrde it to the specified version: https://github.com/benrbray/prosemirror-math/blob/9cf572db4b6258a2de1c3f1d577b865116155342/package.json#L32

For example, I use:

yarn upgrade katex@^0.13.0
benrbray commented 5 months ago

I resolved this when updating dependencies in a recent PR, the fix will appear in the next release