Closed idlist closed 11 months ago
My current thought is that as the type RehypePlugin
is actually conflicting with the type Plugin
unified provided (if you denote a plugin using unified's Plugin
, then you have to use as unknown as RehypePlugin
for it to work), and most of the official or community plugins are written in JavaScript (some with d.ts
annotations), for now it might be better to just update the docs about setting up TypeScript to mention that you might need to use as RehypePlugin
as a workaround... 🤔
I'm going to move this over to the docs repo since it's a DX issue with a package they recommend!
It looks like the file might be missing a title. Additionally, there seems to be a conflict between the file name and the code block extension. The text references a .mjs document, but the code block is marked as TypeScript.
Haven't figured out the reason yet, but manually installing @types/hast
(one of rehype-external-links' dependencies) seems to resolve the error 🤔
npm install --save-dev @types/hast@^3.0.0
I don't know why but updating to newer Astro version (still in v3) fixes this issue. And it seems like Astro v4 does not have this issue, so I'm closing this issue for now.
Edit: I just found that it might be because that I installed @types/hast
(though for my case it's because I needed it for using hast
related utilities) that I didn't have the issue anymore. If someone still have this issue and happens to see this thread, please try installing it (as said above).
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I'm trying to follow the Add icons to external links recipe, and I ran into this problem:
The error says:
a workaround would be (or actually it might be the only practical solution for now):
What's the expected result?
No errors are reported.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-pxea2u?file=astro.config.ts&on=stackblitz
Participation