Skip to content

Start RC - lazyFn for loader with head results in type error #5235

@checkerschaf

Description

@checkerschaf

Which project does this relate to?

Router

Describe the bug

After upgrading to RC I've seen this type error that was working fine before the upgrade.

Error:

Type 'Promise<{ id: string; title: string; body: string; }>' is not assignable to type 'never'

Your Example Website or App

https://github.com/checkerschaf/tanstack-start-lazyfn-loader-head-bug/blob/main/src/routes/posts.%24postId.tsx#L10

Steps to Reproduce the Bug or Issue

  1. Clone the reproduction repo
  2. Open the posts.$postId.ts file
  3. See the type error

When removing the params from the head function the error is gone.

Functionally the behaviour seems correct.

Expected behavior

No type error. The same code was working before the RC release.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.132.6
  • OS: macOS
  • Browser: -
  • Browser Version: -
  • Bundler: vite

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesChanges to the typescript types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions