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

[Bug]: Panic from markdown-1.0.0-alpha.16 on build #1307

Open
hayzamjs opened this issue Aug 7, 2024 · 2 comments
Open

[Bug]: Panic from markdown-1.0.0-alpha.16 on build #1307

hayzamjs opened this issue Aug 7, 2024 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@hayzamjs
Copy link

hayzamjs commented Aug 7, 2024

Version

System:
  OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
  Memory: 7.00 GB / 31.25 GB
  Container: Yes
  Shell: 5.2.15 - /usr/bin/bash
Browsers:
  Chrome: 127.0.6533.88
npmPackages:
  rspress: ^1.27.0 => 1.27.0

Details

When I try to run npm run build i.e. rspress build in my documentation directory I see:

(base) hayzam@hayzam-pc ~/Documents/bad_doc/panic $ RUST_BACKTRACE=full npm run build

> [email protected] build
> rspress build

🔥 Rspress v1.27.0

thread '<unnamed>' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/markdown-1.0.0-alpha.16/src/construct/document.rs:567:77:
index out of bounds: the len is 2 but the index is 2
stack backtrace:
   0:     0x7f7c5abdbfdc - <unknown>
   1:     0x7f7c5ac02b9c - <unknown>
   2:     0x7f7c5abd994e - <unknown>
   3:     0x7f7c5abdbdc4 - <unknown>
   4:     0x7f7c5abdd043 - <unknown>
   5:     0x7f7c5abdcd64 - <unknown>
   6:     0x7f7c5abdd5c5 - <unknown>
   7:     0x7f7c5abdd4c1 - <unknown>
   8:     0x7f7c5abdc506 - <unknown>
   9:     0x7f7c5abdd212 - <unknown>
  10:     0x7f7c5a892255 - <unknown>
  11:     0x7f7c5a892412 - <unknown>
  12:     0x7f7c5abab0d2 - <unknown>
  13:     0x7f7c5abbed12 - <unknown>
  14:     0x7f7c5ab9bebd - <unknown>
  15:     0x7f7c5ab9b480 - <unknown>
  16:     0x7f7c5ab9a364 - <unknown>
  17:     0x7f7c5ab8cef9 - <unknown>
  18:     0x7f7c5a8b47a3 - <unknown>
  19:     0x7f7c5a893462 - <unknown>
  20:           0xc78a49 - _ZZN4node14ThreadPoolWork12ScheduleWorkEvENUlP9uv_work_sE_4_FUNES2_
  21:          0x18ab5b0 - worker
                               at /home/iojs/build/ws/out/../deps/uv/src/threadpool.c:122:5
  22:     0x7f7c89aa8134 - start_thread
                               at ./nptl/pthread_create.c:442:8
  23:     0x7f7c89b287dc - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  24:                0x0 - <unknown>
fatal runtime error: failed to initiate panic, error 5
Aborted
(base) hayzam@hayzam-pc ~/Documents/bad_doc/panic $ 

panic.zip -> This is the zip of my project (without node_modules)

We're working on a CMS and recently migrated from Docusaurus. All the files in the folder inside the zip is auto generated from a DB, it could be that I'm doing something wrong in the files but in any case a panic doesn't sound good?

Reproduce link

https://github.com/user-attachments/files/16529114/panic.zip

Reproduce Steps

Run npm install and npm run build and you ideally should see the error described in details.

@hayzamjs hayzamjs added the 🐞 bug Something isn't working label Aug 7, 2024
@hayzamjs
Copy link
Author

hayzamjs commented Aug 7, 2024

I figured the issue out (it was that I was referencing stuff that wasn't available in the index.md file), once I took care of that the panic went away.

@SoonIter
Copy link
Member

SoonIter commented Aug 7, 2024

yeah, I also solved this by modifying docs/1.0.0/index.mdx

---
pageType: home
hero:
  name: Kalmia
  text: Fast, easy-to-use CMS for your documentations
  tagline: Tagline
  actions:
    - theme: brand
      text: Quick Start
      link: /guide/
    - theme: alt
      text: GitHub
      link: https://github.com/web-infra-dev/rspress
  image:
    src: /rspress-icon.png
    alt: Rspress Logo

features:
  - title: Blazing fast build speed
    details: The core compilation module is based on the Rust front-end toolchain, providing a more ultimate development experience.
    icon: 🏃🏻‍♀️
  - title: Support for MDX content writing
    details: MDX is a powerful way to write content, allowing you to use React components in Markdown.
    icon: 📦
  - title: Built-in full-text search
    details: Automatically generates a full-text search index for you during construction, providing out-of-the-box full-text search capabilities.
    icon: 🎨
  - title: Simpler I18n solution
    details: With the built-in I18n solution, you can easily provide multi-language support for documents or components.
    icon: 🌍
  - title: Static site generation
    details: In production, it automatically builds into static HTML files, which can be easily deployed anywhere.
    icon: 🌈
  - title: Providing multiple custom capabilities
    details: Through its extension mechanism, you can easily extend theme UI and build process.
    icon: 🔥
---

this is an error from markdown-rs imported from mdx-rs, your markdown did not follow the grammar, resulting in parsing errors.

we'll track the error message handling in web-infra-dev/mdx-rs#49

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

No branches or pull requests

2 participants