Skip to content
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

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

Open
heivo opened this issue Jan 8, 2025 · 0 comments
Open

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

heivo opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@heivo
Copy link

heivo commented Jan 8, 2025

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.

@heivo heivo added the bug label Jan 8, 2025
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

1 participant