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

OMG,我遇到了点问题,关于这个字段remarkPluginFrontmatter #25

Closed
king-zhangbn opened this issue Dec 3, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@king-zhangbn
Copy link

我今天闲的慌想更新一下到最新版本,因为换仓库了,我大部分重新折腾了一下,但是遇到了remarkPluginFrontmatter这个字段的问题,
image

src/components/blog/Hero.astro:16:9 - error ts(2339): Property 'remarkPluginFrontmatter' does not exist on type 'RenderResult | { Content(props: Record<string, any>): AstroComponentFactory; headings: MarkdownHeading[]; }'.

但是我将hero.ASTRO中的

const { remarkPluginFrontmatter } = await render()

变成

const { remarkPluginFrontmatter } = (await render()) as {
  remarkPluginFrontmatter: Record<string, any>;
};

好像就可以跑了

@cworld1
Copy link
Owner

cworld1 commented Dec 3, 2024

@king-zhangbn 这个代码好像是预估阅读时间的,我这上次提交的时候貌似没有这个问题。是类似于“提交了一个空白文档”之类的特殊情况吗

@king-zhangbn
Copy link
Author

不是,我的所有文档都是有内容的诶,我也不知道这是什么情况诶,但是现在能跑!啊哈

@cworld1
Copy link
Owner

cworld1 commented Dec 3, 2024

@king-zhangbn 因为这个项目使用typescript,所以any类型会被linter警告为 unexpected type。看来得把类型敲定。等待后续更新。

@cworld1 cworld1 added the bug Something isn't working label Dec 3, 2024
@cworld1 cworld1 linked a pull request Dec 3, 2024 that will close this issue
@cworld1
Copy link
Owner

cworld1 commented Dec 7, 2024

下次更新改动较大,故现有设定无法作用。不排除这里可能会出现问题。如有问题还请继续反馈。

@cworld1 cworld1 closed this as completed Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants