question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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:

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marandanetocommented, Sep 27, 2022

https://github.com/getsentry/sentry-react-native/blob/e96259b6ed55622619015e580ed9ca98f29ef8d5/package.json#L57

On the next major version v5, the wizard was moved to the dev deps, so please upgrade your SDK when you feel comfortable with, since its not GA yet.

0reactions
kopax-polyconseilcommented, Sep 8, 2022

Keep open

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to shrink (tree-shake) lodash in bundle file for React ...
By implementing tree shaking practices, the performance of your React Native applications will be improved and the bundle size reduced. The idea ...
Read more >
The Correct Way to Import Lodash Libraries: A Benchmark
In this article, we'll talk about ways and methods to optimize imports of the Lodash library both with and without external plugins. We...
Read more >
Correct way of importing and using lodash in Angular
I now get the following error when using that statement: '"{...}/node_modules/@types/lodash/index"' has no exported member 'debounce'.
Read more >
Optimization of Lodash styling and bundle size
In big projects dealing with the styling of Lodash imports alone may quickly become a mess, and a single “whole library” import will...
Read more >
JavaScript Lodash Tutorial - YouTube
A few weeks ago, I explored Lodash https:// lodash.com/ an Essential JavaScript Utility library. Other fellow programmers used this library ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found