openshift / openshift/console

Console 5.1 - react-router is missing useNavigate function

Open
#17,189 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
460
Forks
756
Avg merge
4d 2h
Merged PRs (30d)
88

Description

The plugin fails at runtime with:

(0 , react_router__WEBPACK_IMPORTED_MODULE_1__.useNavigate) is not a function

Minimal code to reproduce the problem: https://github.com/rszwajko/console_router_bug
Initially encountered in the https://github.com/openshift/networking-console-plugin

Workarounds tried (no success):

  1. upgrading to 4.23.0-prerelease.5
  2. downgrading to 4.22.0

Steps:

  1. start plugin dev server: npm run start
  2. start the bridge CONSOLE_IMAGE="quay.io/openshift/origin-console:5.1" npm run start-console
    NOTE that the sample works if started with CONSOLE_IMAGE="quay.io/openshift/origin-console:5.0"
  3. navigate to http://localhost:9000/router-bug
    Expected result: an empty state page is displayed
    Actual result: runtime error is shown
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal reproduction at https://github.com/rszwajko/console_router_bug and follow the listed npm run start and CONSOLE_IMAGE="quay.io/openshift/origin-console:5.1" npm run start-console steps. Compare behavior with the 5.0 image and investigate why useNavigate is unavailable; done means visiting /router-bug displays the empty state page without a runtime error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.