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

Failed to find parent screen controller #2717

Closed
faljabi opened this issue Feb 19, 2025 · 16 comments · Fixed by #2719
Closed

Failed to find parent screen controller #2717

faljabi opened this issue Feb 19, 2025 · 16 comments · Fixed by #2719
Labels
Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS

Comments

@faljabi
Copy link

faljabi commented Feb 19, 2025

Description

Hi,

After upgrading from 4.6.0 to 4.7.0 or 4.8.0 I am getting the below error attached. I am on old arch.

Steps to reproduce

Image

Snack or a link to a repository

https://picture.attached.com

Screens version

4.7.0 or 4.8.0

React Native version

0.77.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Real device

Device model

iPhone 16 Pro Max

Acknowledgements

Yes

@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Missing repro This issue need minimum repro scenario labels Feb 19, 2025
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@InzamamAbbasii
Copy link

InzamamAbbasii commented Feb 20, 2025

I faced the same issue. After hours of debugging, I discovered that the error occurs when using navigation.replace("Login"). However, when I use navigation.navigate("Login"), it works fine. I’m not sure why this happens.

@TomAtterton
Copy link

Yeah also getting the same error on navigation.reset. I just did a quick check with the new architecture to confirm and it indeed stopped the crashing. Although annoyingly i can't do the migration as currently there are too many other issues around the new architecture for my project....

@InzamamAbbasii
Copy link

I resolved this issue by downgrading the navigation and screen packages while using React Native 0.74.2. The versions I used are:

@react-navigation/bottom-tabs: ^6.5.7
@react-navigation/native: ^6.1.6
@react-navigation/native-stack: ^6.9.12
react-native-screens: ^3.20.0

@VictorioMolina
Copy link

same here

    "@react-navigation/bottom-tabs": "^7.0.0-rc.34",
    "@react-navigation/drawer": "^7.0.0-rc.32",
    "@react-navigation/elements": "^2.0.0-rc.26",
    "@react-navigation/material-top-tabs": "^6.6.14",
    "@react-navigation/native": "^7.0.0-rc.21",
    "@react-navigation/native-stack": "^7.0.0-rc.29",
    "@react-navigation/stack": "^7.0.0-rc.28",
    "expo": "^51.0.24",
    "react-native": "0.74.5",
    "react-native-safe-area-context": "^5.2.0",
    "react-native-screens": "^4.8.0",

@kkafar
Copy link
Member

kkafar commented Feb 20, 2025

I'm working on it. I'll release a patch in ~1h

kkafar added a commit that referenced this issue Feb 20, 2025
… content wrapper (#2719)

## Description

Closes #2717

For some reason on old architecture, when calling `navigation.replace()`
the replaced screen receives `willMoveToWindow:` message from UIKit with
non-nil argument, defying my previous expectations. 

On new architecture this works as expected: removed screen receives
`nil` window & we do not run the content-wrapper-attachment logic.

## Changes

Error is logged only on new architecture now.

## Test code and steps to reproduce

WIP

## Checklist

- [x] Included code example that can be used to test this change
- [ ] Ensured that CI passes
@steinalex
Copy link

@kkafar I'm also seeing this problem after upgrading to 4.8.0. Do you know roughly when a patch will be released? 🙏

@kkafar
Copy link
Member

kkafar commented Feb 21, 2025

I hope to have stable 4.9.0 released today. But I guess I can release another beta in 20 minutes.

BUT please note that 4.9.0-beta.x requires 0.78 react-native version.

@kkafar
Copy link
Member

kkafar commented Feb 21, 2025

@steinalex 4.9.0-beta.1 is available on npm

@steinalex
Copy link

Thanks for the update @kkafar.

Just to confirm, will the non-beta release (4.9.0) also require "react-native": "0.78.0"? I'm running "react-native": "0.76.7" with Expo 52, and I don't think I can upgrade RN beyond that

@VictorioMolina
Copy link

VictorioMolina commented Feb 21, 2025

@kkafar @steinalex same question here

@kkafar
Copy link
Member

kkafar commented Feb 21, 2025

@steinalex I'm not sure how the backward compatibility will look like yet. I'm working on bringing it in this very moment.

@jdarshan5
Copy link

jdarshan5 commented Feb 21, 2025

@kkafar Will it be mandatory for 4.9.0 to have react native version >=0.78.0? as upgrading to 0.78 is not possible in my case as we are working on 0.76.7, by disabling the new arch, and we are concurrently solving the layout issues because of migrating to new arch

@steinalex
Copy link

From what I understand, Expo 52 (latest SDK) doesn't support React Native higher than 0.76: https://github.com/expo/expo/blob/sdk-52/package.json#L22.

I think Expo 52 users (myself included) will be stuck on this issue unless it's supported on older RN versions

@vendramini
Copy link

@kkafar
Copy link
Member

kkafar commented Feb 21, 2025

I've just released 4.9.0. Old architecture should work from 0.76 onward & new architecture should work from 0.77 onward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS
Projects
None yet
8 participants