Skip to content

Missing lodash dependency causes "Unable to resolve" error during build #160

@amdrade

Description

@amdrade

Hi there!

First of all, thanks for the great library. I've encountered a build error when trying to use @openspacelabs/react-native-zoomable-view in an Expo/React Native project.

The Problem:
The file ReactNativeZoomableView.tsx imports debounce from lodash on line 33, but lodash is not listed as a dependency in the package.json file. This results in the following error:

Unable to resolve "lodash" from "node_modules/@openspacelabs/react-native-zoomable-view/src/ReactNativeZoomableView.tsx"

Steps to Reproduce:

  1. Install @openspacelabs/react-native-zoomable-view.
  2. Try to build/run the project.
  3. The Metro bundler fails because it cannot find the lodash module.

Suggested Fix:
Add lodash to the dependencies section in package.json.

Environment:

  • React Native / Expo
  • Library version: ^2.4.2
Unable to resolve "lodash" from "node_modules/@openspacelabs/react-native-zoomable-view/src/ReactNativeZoomableView.tsx"
  31 | import { viewportPositionToImagePosition } from './helper/coordinateConversion';
  32 | import { StaticPin } from './components/StaticPin';
  33 | import { debounce } from 'lodash';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions