Skip to content

namedAction TS error when v3_singleFetch: true #399

@davidesigner

Description

@davidesigner

Describe the bug

Since I've migrated my action to the singleFetch approach (replace json by data or nothing), namedAction has error and useFetcher<typeof action>().data is unknown.

I cannot do anymore:

return namedAction(request, {
Screenshot 2024-10-16 at 19 13 56

When I replace this by:

return namedAction(await request.clone().formData(), {

I have error on the name of the action:
Screenshot 2024-10-16 at 19 09 33

Here is the details of the error:
Screenshot 2024-10-16 at 19 02 50

And the useFetcher<typeof action>().data is unknown:
Screenshot 2024-10-16 at 19 10 46

Your Example Website or App

n/a (maybe you don't need it for this bug?)

Steps to Reproduce the Bug or Issue

  1. Enable singleFetch.
  2. See the "describe of the bug" ⬆️ to reproduce.

Expected behavior

That it works as it did before activating singleFetch.

Screenshots or Videos

No response

Platform

  • Remix version: 2.13.1
  • Remix utils version: 7.7.0
  • Typescript version: 5.6.3

Additional context

I hope you will understand the problem easily, if not, tell me and I can invest more time to give you a reproduction environment 🙏.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions