katex error: Module parse failed: Identifier directly after number
jackykwandesign opened this issue · 6 comments
jackykwandesign commented
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
"rehype-katex": "^6.0.1"
Link to runnable example
https://github.com/jackykwandesign/react-markdown-katex-error
Steps to reproduce
- just use rehype-katex in react-markdown will produce error
Expected behavior
show katex
Actual behavior
show babel-loader error
Failed to compile.
./node_modules/hast-util-to-text/index.js 363:65
Module parse failed: Identifier directly after number (363:65)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // break is the zero-width space character (U+200B), then the break is
| // removed, leaving behind the zero-width space.
> if (lines[index].charCodeAt(lines[index].length - 1) === 0x20_0b
| /* ZWSP */
| || index < lines.length - 1 && lines[index + 1].charCodeAt(0) === 0x20_0b
Runtime
Node v12
Package manager
yarn v1
OS
Linux
Build and bundle tools
Create React App
ChristianMurphy commented
The error is coming from hast-util-to-text
.
This is being discussed at syntax-tree/hast-util-to-text#4
ustcsy commented
same problem, React 17.0.2
wooorm commented
Then please comment on the place where the discussion is being held about this problem with details.
MagicMarvel commented
I am a freshman in programing and can't understand your solution, but i found using the specific version remark-math@4.0.0 would deal with this problem.
wooorm commented
Please see the linked discussion, read through it, and provide information there
wooorm commented
solved over there