Skip to content

Incorrect types for loader data that contain Record types #13058

Closed
@Varkoff

Description

@Varkoff

I'm using React Router as a...

framework

Reproduction

Unfortunately Stackblitz does not support Node v20. Check reproduction code here :
https://github.com/Varkoff/react-router-type-error-with-markdoc

Since upgrading to React Router v7.2.0, I've been getting this Type 'unknown' is not assignable to type 'RenderableTreeNodes'.ts(2322) error.

Can you please take a look @pcattori ?

System Info

System:
    OS: macOS 15.3
    CPU: (10) arm64 Apple M2 Pro
    Memory: 84.78 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
    npm: 10.8.3 - ~/.nvm/versions/node/v22.9.0/bin/npm
    pnpm: 9.7.1 - ~/Library/pnpm/pnpm
    bun: 1.1.38 - ~/.bun/bin/bun
    Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 133.0.6943.99
    Safari: 18.3
  npmPackages:
    @react-router/dev: ^7.2.0 => 7.2.0 
    @react-router/express: ^7.2.0 => 7.2.0 
    @react-router/node: ^7.2.0 => 7.2.0 
    @react-router/serve: ^7.2.0 => 7.2.0 
    react-router: ^7.2.0 => 7.2.0 
    vite: ^5.1.0 => 5.4.14

Used Package Manager

npm

Expected Behavior

I would like to not have the type error.

Actual Behavior

I am getting type errors, which prevent me to update code without adding @ts-ignore or @ts-expect-error flags. CI fails.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions