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.

Extra code found in the production build

See original GitHub issue

Bug report

What is the current behavior?

input: https://github.com/dgeibi/webpack-tree-shaking-bug/blob/master/src/App.js image

extra useRef() found in the production build

image

If the current behavior is a bug, please provide the steps to reproduce.

clone https://github.com/dgeibi/webpack-tree-shaking-bug

npm run build

output: dist/main.js

What is the expected behavior?

no extra useRef() in the useEffect’s callback

Other relevant information: webpack version: 4.46.0 and 5.33.2 Node.js version: 14.16.0 Operating System: macOS 11.2.3 Additional tools:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-akaitcommented, Apr 29, 2021

Fixed in 5.7.0, please update deps (https://github.com/terser/terser/commits/master), let’s close, for webpack we have PR from dependabot

@csvan thanks for point on this

0reactions
csvancommented, Apr 29, 2021

Seems to be closed in Terser, but not sure if released

https://github.com/terser/terser/commit/84c1a314ed43fa3f367159c140175791b5d06b9c

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app is showing all my code in production, how to ...
It seems to be correct behaviour in create-react-app according to Issue #1632. Gaeron: This is expected. You can delete .map files from the ......
Read more >
Creating a Production Build - Create React App
If you're using code splitting to split up your application, this will create additional chunks in the build/static folder as well.
Read more >
Reactjs Build Production: Optimize Performance - CopyCat Blog
The production mode minifies your code, optimises assets, and produces lighter weight source maps. Also, the warning messages and other features ...
Read more >
How to fix build failures with `create-react-app` in production
First solution (recommended) Look into your build logs, and find any warnings printed by your build command. Fixing those warnings will make ...
Read more >
Optimizing Performance - React
Use the Production Build. If you're benchmarking or experiencing performance problems in your React apps, make sure you're testing with the minified production...
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