starlight-blog icon indicating copy to clipboard operation
starlight-blog copied to clipboard

excert leads to exception during rss generation

Open pelikhan opened this issue 7 months ago • 8 comments

Describe the bug

I started adding the excerpt to the front matter and it seems to be making the RSS generation unhappy.

16:17:42 ▶ starlight-blog/routes/Authors.astro
16:17:42   ├─ /blog/authors/peli/index.html (+51ms) 
16:17:42   └─ /blog/authors/genaiscript/index.html (+16ms) 
16:17:42 λ starlight-blog/routes/rss.xml.ts
16:17:42   └─ /blog/rss.xmlCannot use 'in' operator to search for 'tokens' in Yohan Lasorsa presented GenAIScript at dotJS 2025, introducing a scripting language designed to enhance AI model interactions. As a Principal Developer Advocate at Microsoft and a seasoned expert in Angular, Yohan brings over 15 years of experience in applied research, cloud architecture, and full-stack development. His work reflects a passion for innovation and knowledge-sharing, exploring the boundaries of technology in both professional and personal projects.
Please report this to https://github.com/markedjs/marked.
  Stack trace:
    at a.includes.h.includes.d.includes.s.<computed> (file:///workspaces/genaiscript/docs/dist/pages/_---prefix_/rss.xml.astro.mjs?time=1744215462351:75:23)
    at _Parser.parseInline (file:///workspaces/genaiscript/docs/node_modules/marked/lib/marked.esm.js:2007:37)
    at parse (file:///workspaces/genaiscript/docs/node_modules/marked/lib/marked.esm.js:1803:23)
    at stripMarkdown (file:///workspaces/genaiscript/docs/dist/pages/_---prefix_/rss.xml.astro.mjs?time=1744215462351:97:27)
    at file:///workspaces/genaiscript/docs/dist/pages/_---prefix_/rss.xml.astro.mjs?time=1744215462351:125:30```

Blog post:

---
title: "Prompting is the New Scripting: Meet GenAIScript - Yohan Lasorsa - dotJS 2025"
date: 2025-04-09
authors: pelikhan
canonical_url: https://microsoft.github.io/genaiscript/blog/prompting-is-the-new-scripting
cover:
  alt: A simplified 8-bit illustration of a presentation stage with a
    coding-inspired backdrop. The design incorporates geometric patterns
    symbolizing AI and interconnected circuits, presented in a corporate and
    futuristic style. It uses five distinct colors with bold, clean lines,
    focusing on tech innovation through abstraction, without characters or text
    for added minimalism.
  image: ./prompting-is-the-new-scripting.png
excerpt: Yohan Lasorsa presented GenAIScript at dotJS 2025, introducing a
  scripting language designed to enhance AI model interactions. As a Principal
  Developer Advocate at Microsoft and a seasoned expert in Angular, Yohan brings
  over 15 years of experience in applied research, cloud architecture, and
  full-stack development. His work reflects a passion for innovation and
  knowledge-sharing, exploring the boundaries of technology in both professional
  and personal projects.
tags:
  - GenAIScript
  - AI scripting language
  - dotJS 2025 talk
  - Yohan Lasorsa
  - Microsoft Developer Advocate

---

import { YouTube } from "astro-embed"

[Yohan Lasorsa](https://www.linkedin.com/in/yohanlasorsa/) gave a talk at dotJS 2025 about GenAIScript, a new way to interact with AI models using a scripting language.

Yohan Lasorsa is a Principal Developer Advocate at Microsoft, a Google Developer Expert for Angular, and an active open-source author and contributor. 
With 15+ years of experience across applied research, mobile, IoT, and cloud architecture, 
he has worked from low-level systems to full-stack web development. 
Whether building applications or DIY projects, he loves sharing knowledge and pushing the limits of what’s possible.

<YouTube id="https://youtu.be/PrhPSUHXWJ4?" portraitQuality="high" />

To Reproduce

Create a blog post with excerpt and turn on RSS. Build blog.

Expected behavior

Does not crash.

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

pelikhan avatar Apr 09 '25 16:04 pelikhan

I tried node v20, 22, 23 same error.

pelikhan avatar Apr 09 '25 16:04 pelikhan

Very weird, thanks for the report 🤔

I've tried multiple scenarios, using the exact example post you shared, and many other cases, tried different versions of Node.js too, etc. but I didn't manage to reproduce the issue at all.

Would you be able to provide some kind of repro? Even if it's a small setup with a single post with the issue would be enough.

HiDeoo avatar Apr 09 '25 18:04 HiDeoo

Here are a few screenshot of the debugging session Image

Image

At this point, e is a string and it blows off.

Image

The string came from .text here.

Image

pelikhan avatar Apr 09 '25 18:04 pelikhan

astro@^5.6.1:
  version "5.6.1"
  resolved "https://registry.yarnpkg.com/astro/-/astro-5.6.1.tgz#063719f320d5eafacf895e9842ae4c060bc2e036"
  integrity sha512-aQ2TV7wIf+q2Oi6gGWMINHWEAZqoP0eH6/mihodfTJYATPWyd03JIGVfjtYUJlkNdNSKxDXwEe/r/Zx4CZ1FPg==
  dependencies:
    "@astrojs/compiler" "^2.11.0"
    "@astrojs/internal-helpers" "0.6.1"
    "@astrojs/markdown-remark" "6.3.1"
    "@astrojs/telemetry" "3.2.0"
    "@oslojs/encoding" "^1.1.0"
    "@rollup/pluginutils" "^5.1.4"
    acorn "^8.14.1"
    aria-query "^5.3.2"
    axobject-query "^4.1.0"
    boxen "8.0.1"
    ci-info "^4.2.0"
    clsx "^2.1.1"
    common-ancestor-path "^1.0.1"
    cookie "^1.0.2"
    cssesc "^3.0.0"
    debug "^4.4.0"
    deterministic-object-hash "^2.0.2"
    devalue "^5.1.1"
    diff "^5.2.0"
    dlv "^1.1.3"
    dset "^3.1.4"
    es-module-lexer "^1.6.0"
    esbuild "^0.25.0"
    estree-walker "^3.0.3"
    flattie "^1.1.1"
    github-slugger "^2.0.0"
    html-escaper "3.0.3"
    http-cache-semantics "^4.1.1"
    js-yaml "^4.1.0"
    kleur "^4.1.5"
    magic-string "^0.30.17"
    magicast "^0.3.5"
    mrmime "^2.0.1"
    neotraverse "^0.6.18"
    p-limit "^6.2.0"
    p-queue "^8.1.0"
    package-manager-detector "^1.1.0"
    picomatch "^4.0.2"
    prompts "^2.4.2"
    rehype "^13.0.2"
    semver "^7.7.1"
    shiki "^3.2.1"
    tinyexec "^0.3.2"
    tinyglobby "^0.2.12"
    tsconfck "^3.1.5"
    ultrahtml "^1.6.0"
    unist-util-visit "^5.0.0"
    unstorage "^1.15.0"
    vfile "^6.0.3"
    vite "^6.2.4"
    vitefu "^1.0.6"
    xxhash-wasm "^1.1.0"
    yargs-parser "^21.1.1"
    yocto-spinner "^0.2.1"
    zod "^3.24.2"
    zod-to-json-schema "^3.24.5"
    zod-to-ts "^1.2.0"
  optionalDependencies:
    sharp "^0.33.3"

pelikhan avatar Apr 09 '25 18:04 pelikhan

maybe it's pull the wrong 'marked'?

[email protected] /workspaces/genaiscript/docs
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
└─┬ [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected] deduped
  │ ├─┬ [email protected]
  │ │ └── [email protected] deduped
  │ └── [email protected]
  ├─┬ [email protected]
  │ └── [email protected] deduped
  └── [email protected]

pelikhan avatar Apr 09 '25 18:04 pelikhan

That's weird, and the versions looks good compared to a working version :thinking:

Looks like it's using yarn, could you try for testing enforcing the marked version to something like 15.0.8 using selective dependency resolutions in your package.json file:

"resolutions": {
  "marked": "15.0.8"
}

HiDeoo avatar Apr 10 '25 08:04 HiDeoo

The resolution rule fixed it. So there's some kind of mistmatch with marked 12 (from astro-remote) and 15 which leads to this error.

pelikhan avatar Apr 10 '25 10:04 pelikhan

Wow, I'd been hitting this and was really stumped -- the resolution rule worked for me as well!

stephenh avatar May 27 '25 05:05 stephenh