textlint / textlint-plugin-latex2e

Textlint Plugin LaTeX2ε
MIT License
67 stars 8 forks source link

Error: "Cannot read property 'loc' of undefined" #52

Closed shirayu closed 3 years ago

shirayu commented 3 years ago

Minimum operation for the error

mkdir -p /tmp/err_sample
cd  /tmp/err_sample
npm install textlint textlint-plugin-latex2e textlint-rule-no-nfd
echo '{"plugins":["latex2e"],"rules":{"no-nfd":true}}' > .textlintrc
echo -e 'A%B\nC' > sample.tex
npx textlint ./sample.tex

No error with the following setting.

echo '{"rules":{"no-nfd":true}}' > .textlintrc
npx textlint ./sample.tex

Here is package-lock.json.

Error message

✖ Error
Cannot read property 'loc' of undefined

✖ Stack trace
TypeError: Cannot read property 'loc' of undefined
    at validate (/private/tmp/err_sample/node_modules/@textlint/kernel/lib/context/TextlintSourceCodeImpl.js:37:14)
    at new TextlintSourceCodeImpl (/private/tmp/err_sample/node_modules/@textlint/kernel/lib/context/TextlintSourceCodeImpl.js:56:9)
    at TextlintKernel._parallelProcess (/private/tmp/err_sample/node_modules/@textlint/kernel/lib/textlint-kernel.js:153:26)
    at /private/tmp/err_sample/node_modules/@textlint/kernel/lib/textlint-kernel.js:100:26
npm ERR! code 1
npm ERR! path /private/tmp/err_sample
npm ERR! command failed
npm ERR! command sh -c textlint ./sample.tex

Environment

$  npm list
err_sample@ /private/tmp/err_sample
├── textlint-plugin-latex2e@1.0.4
├── textlint-rule-no-nfd@1.0.2
└── textlint@11.7.7
tani commented 3 years ago

Thank you for reporting issue. I also got this error in my environment. It is occurred by comment syntax in LaTeX. I fix this issue in this two days. Best regards,

pddg commented 3 years ago

@tani I started about this issue today. It will cause by my implementation about the completion of the comment. I will fix it as soon as I can.

tani commented 3 years ago

Great! Thank you for your help!

tani commented 3 years ago

Related issue. https://twitter.com/cocoaofblack/status/1346667253618548736?s=20

tani commented 3 years ago

@shirayu I am reviewing #57. It will close this issue. Please wait a day.

tani commented 3 years ago

pddg sloves this issue. I released v1.0.6 on npm. Please check it out. Thanks.

shirayu commented 3 years ago

Thank you so much!