Skip to content

Markdown files generate invalid route types #12561

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

Closed
mattoni opened this issue Dec 16, 2024 · 1 comment
Closed

Markdown files generate invalid route types #12561

mattoni opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@mattoni
Copy link

mattoni commented Dec 16, 2024

I'm using React Router as a...

framework

Reproduction

Tried making a repro on StackBlitz, but react router requires node v20 and stackblitz is locked to v18.

Essentially, when using .md files (with the proper plugins in vite), the generated route types have type errors in them that make typescript fail

  • Add MD files and plugin to vite
  • expand generated types folder and notice they have a type error on the import line.

System Info

System:
    OS: Linux 6.12 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 14.19 GB / 46.95 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 23.4.0 - /usr/local/share/nvm/versions/node/v23.4.0/bin/node
    npm: 10.9.2 - /usr/local/share/nvm/versions/node/v23.4.0/bin/npm
    pnpm: 9.12.3 - /usr/local/share/nvm/versions/node/v23.4.0/bin/pnpm

Used Package Manager

pnpm

Expected Behavior

Generated types don't have type errors

Actual Behavior

image

I'm assuming this is happening because it's looking for a ts/js file in the matched route, when in reality its a .md file.

@mattoni mattoni added the bug label Dec 16, 2024
@timdorr
Copy link
Member

timdorr commented Dec 16, 2024

Duplicate of #12362

@timdorr timdorr marked this as a duplicate of #12362 Dec 16, 2024
@timdorr timdorr closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants