software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

Error export 'PressableProps' (reexported as 'PressableProps') was not found in './PressableProps' (module has no exports) #3056

Closed JulianV8 closed 2 months ago

JulianV8 commented 3 months ago

Description

Error in ./node_modules/react-native-gesture-handler/lib/module/components/Pressable/index.js 1:0-50 export 'PressableProps' (reexported as 'PressableProps') was not found in './PressableProps' (module has no exports)

This does not happen with version 2.17.1, leaving it static in the json package without the caret.

image

Steps to reproduce

  1. In the package.json -> "react-native-gesture-handler": "^2.18.1",
  2. yarn install
  3. npm run web

Snack or a link to a repository

https://www.npmjs.com/package/react-native-gesture-handler

Gesture Handler version

2.18.1

React Native version

0.74.1

Platforms

Web

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

None

Build type

Debug mode

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 3 months ago

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?

JulianV8 commented 3 months ago

https://www.npmjs.com/package/react-native-gesture-handler

m-bert commented 3 months ago

Hi! Could you provide a reproduction for this issue? We have not seen that and it would be great if we could take a look at it (for example at a repository).

From what I've found, this look more like webpack problem. As stated in this issue, typescript emits no code for exported interfaces, therefore they do not exist for webpack. Inside you can also find link to a plugin that should suppress this error.

j-piasecki commented 3 months ago

It should be fixed by https://github.com/software-mansion/react-native-gesture-handler/pull/3036.

djaffer commented 3 months ago

same I am getting WARNING in ./node_modules/react-native-gesture-handler/lib/module/components/Pressable/index.js:1 export 'PressableProps' (reexported as 'PressableProps') was not found in './PressableProps' (module has no exports)

1 | export { PressableProps } from "./PressableProps"; 2 | export { default } from "./Pressable";

Before reanimated had the warning issue for the longest time and now for this.

m-bert commented 3 months ago

@djaffer could you please check if PR mentioned above fixes that?

djaffer commented 2 months ago

Did this instead of plugin. Regardless this is a hack and not a good way to resolve.

config.ignoreWarnings = [
 /export/,
  ];
m-bert commented 2 months ago

I wouldn't say that adding something to ignoreWarnings is a good way to resolve problem. It would be better to know if this issue was resolved by our changes.

djaffer commented 2 months ago

It was typo**

joker-777 commented 2 months ago

Hi, I'm seeing the same error.

sis3141 commented 2 months ago

My yarn patch file for rngh 2.18.1 , wating for the next release Hope this helps someone!

diff --git a/lib/commonjs/components/Pressable/index.js b/lib/commonjs/components/Pressable/index.js
index 291cd9ae029e873732bea51e455ff874845205d9..5c75d96ca0700574a79220648bfd23ef43aeb1ef 100644
--- a/lib/commonjs/components/Pressable/index.js
+++ b/lib/commonjs/components/Pressable/index.js
@@ -3,12 +3,6 @@
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-Object.defineProperty(exports, "PressableProps", {
-  enumerable: true,
-  get: function () {
-    return _PressableProps.PressableProps;
-  }
-});
 Object.defineProperty(exports, "default", {
   enumerable: true,
   get: function () {
diff --git a/lib/module/components/Pressable/index.js b/lib/module/components/Pressable/index.js
index c80bb64bdb7254c523be272c7089577ebd14ec84..8b2c550a3fd51476dbb620739a9ad7a12bd0307f 100644
--- a/lib/module/components/Pressable/index.js
+++ b/lib/module/components/Pressable/index.js
@@ -1,3 +1,2 @@
-export { PressableProps } from './PressableProps';
 export { default } from './Pressable';
 //# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/lib/module/components/Pressable/index.js.map b/lib/module/components/Pressable/index.js.map
index 666dcd9d970327c9a21d6ebc06fecbf48ced50db..db3a42aa0264b44af0eb6d6409bc389a78f9bc50 100644
--- a/lib/module/components/Pressable/index.js.map
+++ b/lib/module/components/Pressable/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["index.ts"],"names":["PressableProps","default"],"mappings":"AAAA,SAASA,cAAT,QAA+B,kBAA/B;AACA,SAASC,OAAT,QAAwB,aAAxB","sourcesContent":["export { PressableProps } from './PressableProps';\nexport { default } from './Pressable';\n"]}
\ No newline at end of file
+{"version":3,"sources":["index.ts"],"names":["export { default } from './Pressable';\n"]}
\ No newline at end of file
diff --git a/src/components/Pressable/index.ts b/src/components/Pressable/index.ts
index 740b7e13378a19c4e583023a6a0e0629573bf4a0..149c76d90f7b1c1eab6dea8226bcfecb37a4b905 100644
--- a/src/components/Pressable/index.ts
+++ b/src/components/Pressable/index.ts
@@ -1,2 +1,2 @@
-export { PressableProps } from './PressableProps';
+export type { PressableProps } from './PressableProps';
 export { default } from './Pressable';
j-piasecki commented 2 months ago

Please update to React Native Gesture Handler 2.19.0.