Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Element is missing end tag. #3876

Closed
4 tasks done
luo772435545 opened this issue May 9, 2024 · 3 comments
Closed
4 tasks done

SyntaxError: Element is missing end tag. #3876

luo772435545 opened this issue May 9, 2024 · 3 comments

Comments

@luo772435545
Copy link

Describe the bug

vitepress dev is normal, but vitepress build reports an error, SyntaxError: Element is missing end tag. The key is that it is impossible to locate where the end tag is missing.

Reproduction

vitepress build

Expected behavior

Pack normally or provide specific error information

System Info

"vitepress": "^1.1.4"

Additional context

No response

Validations

@luo772435545 luo772435545 added the bug: pending triage Maybe a bug, waiting for confirmation label May 9, 2024
@brc-dd
Copy link
Member

brc-dd commented May 9, 2024

provide specific error information

Will be fixed in next release.

vitepress dev is normal

It won't be. You likely haven't opened the right page.

You can do something like DEBUG='*' npm run docs:build and it will show you the last file where rendering failed.

@brc-dd brc-dd removed the bug: pending triage Maybe a bug, waiting for confirmation label May 9, 2024
@peterbe
Copy link

peterbe commented May 23, 2024

I haven't tested the DEBUG='*' npm run docs:build but it does say which file had the problem.
But annoyingly it's not pointing to the right line. I don't know if it's because of the frontmatter offset or because it's simply hard to know where the </sometag> is missing.

@brc-dd
Copy link
Member

brc-dd commented May 23, 2024

but it does say which file had the problem

Yeah it was added in recent releases.

But annoyingly it's not pointing to the right line

Unfortunately, that's not quite possible because markdown-it doesn't have an AST. We will need to use something like remark for sourcemaps support but it doesn't properly work with Vue.

@brc-dd brc-dd closed this as completed May 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants