-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Minification bug in production build that does not exist when using dev server #8809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See also #8687 |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
I dont think this is resolved, see other issues |
Update: see my comment here #8687 (comment) |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
I see a lot of people saying:
|
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue is still open and it's due to webpack / babel |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
Describe the bug
I tracked down the bug to a return statement that the minifier resolved to return null/nothing, but the dev server returned a component as expected.
Environment
CRA not ejected
react-scripts 3.4.1
bug seen in Firefox, Safari and Chrome on Mac and PC
Steps to reproduce
class arrow function:
After npm run build, this code no longer returns a component.
Expected behavior
Arrow function should return MyComponent (which works fine using dev server)
Actual behavior
After running npm run build, it appears the minifier returns nothing. Even though the return statement wraps its content in parentheses (). Perhaps it is confused by the commented variables //
I corrected the bug by creating a variable and then returning it:
To reproduce the behaviour of the bug I simply return nothing instead of res. This is why I think it is a minification problem that ignores the contents inside the parentheses.
The text was updated successfully, but these errors were encountered: