Open rubenwardy opened 1 year ago
I understand that the template parser probably only receives the content and not the frontmatter, but it should have an offset passed in so that the line numbers match up accurately. Either that, or Eleventy could catch the errors. As it is, the line number is pretty unhelpful and was confusing initially
I started using Eleventy this week and this issue is one of the main pain points I had
Operating system
Linux
Eleventy
2.0.1
Describe the bug
Stacktraces from errors in Markdown files give an incorrect line number. It appears that the length of the front matter is not taken into account.
Reproduction steps
Either use eleventy_repro.zip, or:
npm init
npm install --save @11ty/eleventy
Create
file.md
with the following content:Run
npx @11ty/eleventy
See the following error message mentions "line:2" but the error is on line 6.
Rename
file.md
tofile.liquid
orfile.html
. See same error occursExpected behavior
The error message should say the error is on line 6 of the file. Ideally, this should be given as a single path so it is clickable like:
/home/ruben/dev/tmp/eleventy_repro/file.md:6
Reproduction URL
No response
Screenshots
No response