I keep getting a typescript 'unexpected token' error when using a blockquote in an Astro MDX file and all my googling is coming up with no way of fixing it... #2489
-
So I've recently started playing around MDX and am using the Starlight/Astro docs template. Everything is working fine but when I follow a simple example from https://mdxjs.com/docs/what-is-mdx/ of using a blockquote I constantly get a ts-plugin error: The actual error:
When I actually view the page the blockquote appears just fine without issue: So I was wondering what is causing this issue, I've tried disabling eslint, disabling TS language services, I've tried fixing it with both of the suggestions that pop up and that only solves it until I type something else: If anyone could help me with this I would appreciate it. I can just ignore, but my OCD always like all problems to be 0! EDIT: On further playing around, if I change the language mode at the bottom of VS Code from |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
/cc @remcohaszing seems mdx-analyzer / volar related. This isn’t something in MDX itself. |
Beta Was this translation helpful? Give feedback.
-
Thanks for reporting. This is definitely a bug in MDX analyzer and I managed to reproduce it.
MDX isn’t markdown. If you change the language of a file to something it isn’t, you get incorrect editor support. Since MDX looks a lot like markdown, it may seem ok at first, but you will run into issues. |
Beta Was this translation helpful? Give feedback.
It’s fixed in mdx-js/mdx-analyzer#448 and released in version 1.8.8 of the VSCode MDX extension.