Skip to content

2.27.1 / 2.28.0 Bug with Web Transpilation #3749

@ChrisEdson

Description

@ChrisEdson

Description

On upgrading to 2.27.1 (which persists on 2.28.0), I believe NativeViewGestureHandler.ts is not being transpiled to JavaScript for use on React Native Web.

This may be user error here, but I'm not sure.

All files seem to have been transpiled correctly within lib/module/web - with the exception of NativeViewGestureHandlers.ts.

Image

This results in the following error in React Native Web:

ERROR in ./node_modules/react-native-gesture-handler/lib/module/web_hammer/NativeViewGestureHandler.ts 12:15
Module parse failed: Unexpected token (12:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   }
|
>   onRawEvent(ev: HammerInputExt) {
|     super.onRawEvent(ev);
|     if (!ev.isFinal) {
 @ ./node_modules/react-native-gesture-handler/lib/module/web/Gestures.js 15:0-84 34:28-58
 @ ./node_modules/react-native-gesture-handler/lib/module/RNGestureHandlerModule.web.js 5:0-58 26:27-35 29:27-35 33:27-41 39:27-41
 @ ./node_modules/react-native-gesture-handler/lib/module/init.js 4:0-62 15:4-34
 @ ./node_modules/react-native-gesture-handler/lib/module/index.js 3:0-36 30:0-10
 @ ./index.js 3:166-205

This can be fixed by putting the library through Babel in your Webpack config, but I think it may be a bug?

Steps to reproduce

  1. Run React Native Web with the latest gesture-handler package; do not pass it through Babel

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

N/A

Gesture Handler version

2.27.1

React Native version

0.79.0

Platforms

Web

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