react-native-reanimated: [Web]ReferenceError: _frameTimestamp is not defined

Description

Get this error when upgrading react-native-reanimated to v2.9.0+ on the web (v2.8.0 works), it works fine on iOS and Android.

image

Expected behavior

Works on the web.

Actual behavior & steps to reproduce

web not working when upgrading to v2.9.0+.

Snack or minimal code example

https://github.com/tamagui/starters/tree/main/next-expo-solito

Package versions

name version
react-native 0.68.2
react-native-reanimated 2.9.1
NodeJS 16.15.1
Xcode 13.4.1
Java
Gradle
expo 45.0.2

Affected platforms

  • Android
  • iOS
  • Web

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 10
  • Comments: 26 (2 by maintainers)

Commits related to this issue

Most upvoted comments

We’re still having this issue

I bumped into the issue as well on the latest 3.0.0-rc2. Is there a temporary solution for it?

Stick the following at the top of _app.tsx, outside the component definition:

// FIXME need reanimated update, see https://github.com/software-mansion/react-native-reanimated/issues/3355
if (process.browser) {
  // @ts-ignore
  window._frameTimestamp = null
}

@prateem use this instead:

if (typeof window !== 'undefined') {
  window._frameTimestamp = null;
}

@WillenOLeal I fixed it, but this hasn’t been released yet. I want to release the new version this week.

I’m also facing this issue, on 2.9.1 on web.

For example, in this repo (not minimal): https://github.com/tamagui/starters/tree/main/next-expo-solito

Has anyone found a solution?

Same problem with simple react-native-web project with library v2.9.1 and react-native v0.69.1. Error is in “styleUpdater” function:

Screenshot 2022-07-16 at 1 03 35


Seems quick workaround is to add window._frameTimestamp = null on top of the component file =)

I bumped into the issue as well on the latest 3.0.0-rc2. Is there a temporary solution for it?

Add window._frameTimestamp = null on top of the component file

Bump

Bump