Skip to content

[Web][3.4.0] reanimatedWrapper crashes Vite dev server and increases bundle size in production #4619

Closed

Description

@gigobyte

Description

PR #4554 introduced a regression in the web build of RNGH because of this src import:

require('react-native-reanimated/src/createAnimatedComponent/AnimatedComponent').default

This has the following implications:

  • DEV - Vite web server crashes on init with
Image
  • PROD - Reanimated gets duplicated in the bundle, resulting in additional 190 KB minified

Metro is unaffected because it honours Reanimated's react-native field and compiles src/.

Steps to reproduce

  1. Set up a React Native Web app built with Vite 8, with react-native-gesture-handler@3.4.0.
  2. Use any GestureDetector so reanimatedWrapper is included.
  3. Start the Vite dev server and open the app: it fails with the validate-worklets-version.js ... does not provide an export named 'default' error above.
  4. Run vite build and search the output bundle: AnimatedComponent's lifecycle methods (for example this._NativeEventsManager)==null||ae.attachEvents()) and the _hasWarnedAboutLayoutAnimationStyleOverwriting field show up twice, once from lib/module and once from src.

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

Gesture Handler version

3.4.0

React Native version

0.86.3

Platforms

Web

JavaScript runtime

None

Workflow

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Activity

  1. github-actions commented on Oct 20, 2026

    @github-actions

    Hey @gigobyte! 👋

    Some of the required information in this issue is missing, incomplete or invalid. Could you take another look at the template and make sure each of these is filled in with something we can act on?

    • Description - what happens, and what you expected to happen instead
    • Steps to reproduce - steps somebody else can follow, not just numbering
    • Gesture Handler version - the exact version from your package.json or lockfile
    • React Native version - the exact version from your package.json or lockfile
    • Versions of related libraries you mention (Reanimated, Worklets, Screens, Expo) - the versions actually installed
    • Platforms - the platforms you actually see the bug on

    Once the issue is updated we will take another look. Thanks!

  2. github-actions commented on Oct 20, 2026

    @github-actions

    Hey @gigobyte! 👋

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

    Could you provide a snack, a gist or a link to a GitHub repository that reproduces the problem?

  3. m-bert commented on Oct 20, 2026

    @m-bert
    Collaborator

    Hi @gigobyte! Thank you for reporting this issue! I've prepared #4620 - could you confirm that it fixes the issue?

  4. gigobyte commented on Oct 22, 2026

    @gigobyte
    ContributorAuthor

    I can confirm that it resolves the issue, yes.

  5. added a commit that references this issue on Oct 22, 2026
    a83496b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions