Skip to content

fix: Chrome debugger crash caused by incorrect viewTag - #6437

Merged
MatiPl01 merged 2 commits into
mainfrom
@matipl01/fix-chrome-debugger-crash
Aug 21, 2024
Merged

fix: Chrome debugger crash caused by incorrect viewTag#6437
MatiPl01 merged 2 commits into
mainfrom
@matipl01/fix-chrome-debugger-crash

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Aug 21, 2024

Copy link
Copy Markdown
Member

Summary

The problem was reported in this issue and this discussion seems to report the same problem.

In short, the crash was caused by incorrect check in _getViewInfo in createAnimatedComponent which assigned the _component to the viewTag only for web but not for chrome debugger. I replaced IS_WEB check with shouldBeUseWeb, which also checks whether the current environment is a chrome debugger.

Test plan

  • I created a bare app with npx @react-native-community/cli init ReactNativeDebugger --version 0.75.1
  • Installed latest reanimated and downloaded react-native-debugger mentioned in this issue
  • Launched react-native-debugger and enabled remote debugging with js,
  • When I tried to animate component with animated style, I saw the reported crash

@MatiPl01 MatiPl01 self-assigned this Aug 21, 2024
@MatiPl01
MatiPl01 requested a review from piaskowyk August 21, 2024 14:37

@piaskowyk piaskowyk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHOULD_BE_OK_🫡

@MatiPl01
MatiPl01 enabled auto-merge August 21, 2024 15:01
@MatiPl01
MatiPl01 added this pull request to the merge queue Aug 21, 2024
Merged via the queue into main with commit ce3c1f9 Aug 21, 2024
@MatiPl01
MatiPl01 deleted the @matipl01/fix-chrome-debugger-crash branch August 21, 2024 15:02
r0h0gg6 pushed a commit to r0h0gg6/react-native-reanimated that referenced this pull request Jul 28, 2025
…ion#6437)

## Summary

The problem was reported in
[this](software-mansion#6432)
issue and
[this](software-mansion#6359)
discussion seems to report the same problem.

In short, the crash was caused by incorrect check in `_getViewInfo` in
`createAnimatedComponent` which assigned the `_component` to the
`viewTag` only for web but not for chrome debugger. I replaced `IS_WEB`
check with `shouldBeUseWeb`, which also checks whether the current
environment is a chrome debugger.

## Test plan

- I created a bare app with `npx @react-native-community/cli init
ReactNativeDebugger --version 0.75.1`
- Installed latest reanimated and downloaded
[react-native-debugger](https://github.com/jhen0409/react-native-debugger?tab=readme-ov-file)
mentioned in
[this](software-mansion#6432)
issue
- Launched `react-native-debugger` and enabled remote debugging with js,
- When I tried to animate component with animated style, I saw the
reported crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

debuggerWorker.js:69 TypeError: Cannot convert undefined or null to object

2 participants