Skip to content

Optimization problem with @sentry/react-native within a react-native-web app - lodash gots fully imported  #2409

@kopax-polyconseil

Description

@kopax-polyconseil

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 4.2.2

react-native version: 0.68.2

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise 22.5.0

Configuration:


I have following issue:

We use lodash.* do target exactly which module we need from lodash, but after buildeing our react-native-web app (which is also a react-native app), it appears looking at webpack-bundle-analyzer that one of our dependency (which is sentry-react-native) import the whole lodash. Is this necessary ?

image

see in red the multiple lodash we have now

Steps to reproduce:

  • yarn add @sentry/react-native
  • npm ls lodash

Actual result:

├─┬ @sentry/react-native@4.2.2
│ └─┬ @sentry/wizard@1.2.17
│   ├─┬ inquirer@6.5.2
│   │ └── lodash@4.17.21 deduped
│   └── lodash@4.17.21 deduped

Expected result:

├─┬ @sentry/react-native@4.2.2
│ └─┬ @sentry/wizard@1.2.17
│   ├─┬ inquirer@6.5.2
│   │ └── lodash.something@4.17.21
│   └── lodash.something@4.17.21

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions