Skip to content

handleError in entry.server.ts receives wrong params #12704

Closed
@heivo

Description

@heivo

I'm using React Router as a...

framework

Reproduction

I am using a fetcher to make a server request to a dynamic route, (e.g. /api/:param1/:param2 -> /api/abc/def).

Within the server action the params have the correct values:

param1=abc
param2=def

When there is an error (e.g. by cancelling the request) and I try to access the params within the handleError(error, {params}) function in entry.server.ts the second param has the wrong value:

param1=abc
param2=def.data

System Info

System:
    OS: Linux 6.5 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 9 PRO 7940HS w/ Radeon 780M Graphics
    Memory: 19.45 GB / 29.99 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 22.1.0 - /run/user/1000/fnm_multishells/43342_1736258894791/bin/node
    npm: 10.7.0 - /run/user/1000/fnm_multishells/43342_1736258894791/bin/npm
    pnpm: 9.11.0 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 131.0.6778.204
  npmPackages:
    @react-router/dev: ^7.1.1 => 7.1.1 
    @react-router/express: ^7.1.1 => 7.1.1 
    @react-router/node: ^7.1.1 => 7.1.1 
    react-router: ^7.1.1 => 7.1.1 
    vite: ^5.3.5 => 5.4.9

Used Package Manager

npm

Expected Behavior

Dynamic path params receive the right values in the handleError function of entry.server.ts.

Actual Behavior

When the route ends with a dynamic param the value of this param ends with .data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions