Skip to content

Support Astro 5.9 new API renderMarkdown #3239

@sgalcheung

Description

@sgalcheung

What version of starlight are you using?

0.34.3

What version of astro are you using?

5.9.1

What package manager are you using?

pnpm

What operating system are you using?

Mac

What browser are you using?

Edge

Describe the Bug

My project uses a custom Loader and docs, when I add this new API renderMarkdown, I met an error:

...
BC%89/WebFramework/Astro/starsquid/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.js:204:5)
Failed to parse Markdown file "undefined":
Cannot read properties of undefined (reading 'replace')
  Location:
    eval at runInlinedModule 
...

I found this error because the starlight does not update the dependency.

…/Starlight/starlight main ❯ pnpm why trough
Legend: production dependency, optional only, dev only


devDependencies:
astro 5.6.2
├─┬ @astrojs/markdown-remark 6.3.1
│ ├─┬ rehype-stringify 10.0.1
│ │ └─┬ unified 11.0.5
│ │   └── trough 2.1.0
│ ├─┬ remark-gfm 4.0.1
│ │ ├─┬ remark-parse 11.0.0
│ │ │ └─┬ unified 11.0.5
│ │ │   └── trough 2.1.0
│ │ ├─┬ remark-stringify 11.0.0
│ │ │ └─┬ unified 11.0.5
│ │ │   └── trough 2.1.0
│ │ └─┬ unified 11.0.5
│ │   └── trough 2.1.0
│ ├─┬ remark-parse 11.0.0
│ │ └─┬ unified 11.0.5
│ │   └── trough 2.1.0
│ ├─┬ remark-rehype 11.1.1
│ │ └─┬ unified 11.0.5
│ │   └── trough 2.1.0
│ ├─┬ remark-smartypants 3.0.2
│ │ ├─┬ retext 9.0.0
│ │ │ ├─┬ retext-latin 4.0.0
│ │ │ │ └─┬ unified 11.0.5
│ │ │ │   └── trough 2.1.0
│ │ │ ├─┬ retext-stringify 4.0.0
│ │ │ │ └─┬ unified 11.0.5
│ │ │ │   └── trough 2.1.0
│ │ │ └─┬ unified 11.0.5
│ │ │   └── trough 2.1.0
│ │ └─┬ unified 11.0.5
│ │   └── trough 2.1.0
│ └─┬ unified 11.0.5
│   └── trough 2.1.0
└─┬ rehype 13.0.2
  ├─┬ rehype-parse 9.0.0
  │ └─┬ unified 11.0.5
  │   └── trough 2.1.0
  ├─┬ rehype-stringify 10.0.1
  │ └─┬ unified 11.0.5
  │   └── trough 2.1.0
  └─┬ unified 11.0.5
    └── trough 2.1.0

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-3nw2q24q?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.

Reference: Upgrade @starlight dependency Astro to 5.9 to support new API renderMarkdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions