openspacelabs / react-native-zoomable-view

A view component for react-native with pinch to zoom, tap to move and double tap to zoom capability.
MIT License
191 stars 58 forks source link

Corrupted published package - export 'ReactNativeZoomableViewProps' was not found in './typings' #22

Closed lavor closed 1 year ago

lavor commented 2 years ago

We are using this package in Expo with react-native-web. There is no issue in native application, but web displays following warnings right after build and also in a browser console:

./node_modules/@openspacelabs/react-native-zoomable-view/lib/module/index.js:4
"export 'ReactNativeZoomableViewProps' was not found in './typings'
  2 | import ReactNativeZoomableViewWithGestures from './ReactNativeZoomableViewWithGestures';
  3 | import { ReactNativeZoomableViewProps, ZoomableViewEvent } from './typings';
> 4 | export { ReactNativeZoomableView, ReactNativeZoomableViewWithGestures, ReactNativeZoomableViewProps, ZoomableViewEvent };
  5 | //# sourceMappingURL=index.js.map
  6 |
./node_modules/@openspacelabs/react-native-zoomable-view/lib/module/index.js:4
"export 'ZoomableViewEvent' was not found in './typings'
  2 | import ReactNativeZoomableViewWithGestures from './ReactNativeZoomableViewWithGestures';
  3 | import { ReactNativeZoomableViewProps, ZoomableViewEvent } from './typings';
> 4 | export { ReactNativeZoomableView, ReactNativeZoomableViewWithGestures, ReactNativeZoomableViewProps, ZoomableViewEvent };

I think that problem is somewhere in a build process, where exports of interfaces were not removed from built .js files properly. When I try to comment out the problematic exports in ./node_modules/@openspacelabs/react-native-zoomable-view/lib/module/index.js, the warnings will disappear.

// File ./node_modules/@openspacelabs/react-native-zoomable-view/lib/module/index.js

import ReactNativeZoomableView from './ReactNativeZoomableView';
import ReactNativeZoomableViewWithGestures from './ReactNativeZoomableViewWithGestures';
// import { ReactNativeZoomableViewProps, ZoomableViewEvent } from './typings';
export { ReactNativeZoomableView, ReactNativeZoomableViewWithGestures /*, ReactNativeZoomableViewProps, ZoomableViewEvent*/ };
//# sourceMappingURL=index.js.map
linojon commented 1 year ago

same here, version "^2.0.4"

antonkristiono commented 1 year ago

still no solution

mgroeneweg commented 1 year ago

Same issue, fix mentioned here works! Created a patch in my project to move forward. Hope this gets fixed soon.

ibovegar commented 1 year ago

When will this be fixed?

elliottkember commented 1 year ago

@ibovegar @mgroeneweg @antonkristiono @linojon

Sorry for the delay. I've created #65 which I think will fix this by fixing the import syntax. Could you please try it and let me know?

Side note – PRs are always welcome and the best way to help!