prosemirror-math icon indicating copy to clipboard operation
prosemirror-math copied to clipboard

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

Open iamgabrielsoft opened this issue 2 years ago • 2 comments

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?

iamgabrielsoft avatar Jun 14 '23 05:06 iamgabrielsoft

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

CraigMcCahill avatar Jul 20 '23 08:07 CraigMcCahill

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

li-xin-yi avatar Jul 20 '23 15:07 li-xin-yi

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

benrbray avatar Apr 14 '24 04:04 benrbray