Skip to content

@ionic/react Uncaught TypeError: Cannot read property 'location' of undefined ... IonRouterOutlet.js:40 #17954

Closed

Description

@d3vhound

Bug Report

Ionic version:
[x] 4.x

Current behavior:
Following the conference react app structure nested routes sometimes throw this error randomly. Could be multiple things since both props don't seem to work at all on the IonBackButton component (defaultHref and goBack).

Expected behavior:
The back button on the IonBackButton component should not throw this error and should navigate to the defaultHref if no history exists.

Steps to reproduce:
You can reproduce this error by visiting the already live demo app here at this exact url https://ionic-react-conference-app.firebaseapp.com/schedule/sessions/1 then pressing the back button in the header.

Other information:
Both react apps side by side throwing the same error from pressing back button with no router history.

Screen Shot 2019-04-04 at 7 45 03 AM

Screen Shot 2019-04-04 at 7 44 37 AM

Ionic info:

Ionic:

   ionic (Ionic CLI) : 4.12.0

System:

   NodeJS : v11.4.0
   npm    : 6.9.0
   OS     : macOS Mojave

Activity

  1. added
    package: react
    on Apr 4, 2019
  2. self-assigned this
    on Apr 4, 2019
  3. mattrothenberg commented on May 1, 2019

    @mattrothenberg

    I can confirm this issue as well. Neither the defaultHref nor the goBack props seem to be doing anything on my Ionic React app.

  4. elylucas commented on Jun 6, 2019

    @elylucas
    Contributor

    Fixes for this will be coming up in the next beta release

  5. ionitron-bot commented on Jul 6, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  6. locked and limited conversation to collaborators on Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

package: react

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions