-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Production build not minified #3134
Comments
Can you confirm your NODE_ENV is set to |
i thinks he's referring to
|
@liweinan0423 Yes, confirmed that NODE_ENV is @mcansh Yes, I'm getting that! |
Looks like a 4.1.1 issue as it’s not happening in 4.1.0 |
Did a new release (4.1.2) can you try updating? |
looks good 👍 |
Thanks for verifying @mcansh 👌 |
Looks good! Thanks for your quick response @timneutkens! |
it`s still a issue for me next@4.2.1,the same question happened on the Production enviroment, need help |
Confirm, getting the same on |
Yep, this is worth reopening. I believe React changed their strategy with 16.2.0. |
Getting same on 4.2.3 The error is:
|
@devmetal should be gone in latest canary version. Although getting app.js size twice as large compared to next.js 3 Investigating.. |
@ilionic Thank you for quick answer :) Its working! You made my day! 🥇 |
I'm getting this in 4.2.3 using a custom server and routing. Trying to update to the canary version now to test. Edit: |
@dazjavier I use it for production with custom server and routing, everything is working fine. No bad experience. Maybe a little bit slower in development mode, but its not big issue, and my stack also a little bit heavy, firebase, apollo, etc so maybe that cause this. Anyway, in production is working as expected :) |
@devmetal Thanks for the information. I've using it for 3 days now, and everything works great. No big performance issues for now. |
I am using the 5.0.0 version, and I am getting this error again |
@timneutkens can this be reopened ? |
It's extremely hard to get this message with v5. The only way I'm aware of is removing the react aliases in your next.config.js.
To be clear. React doesn't require minification anymore. If you're using React 16+ the React is already minified when published on npm, the message is purely to point out that there might be something wrong with the transpilation. In our case we made the choice to not minify minified code and alias to the right bundle in dev/prod automatically. This saves ~20seconds with builds for us in production. And we avoid doing unneeded work. If you removed the aliases because you have code using react-dom/server on the client side you can upgrade to |
And here's that canary version: https://github.com/zeit/next.js/releases/tag/5.0.1-canary.2 |
@timneutkens - you are correct. I'd actually done some next.config optimisations between me posted and you posting, removing the alias lines ) - and that does fix it :) |
Expected Behavior
When I'm deploying a production build, I should have minified javascript code in order to minimize file size and maximize performance.
Current Behavior
My app.js is 529KB and not minified
Steps to Reproduce (for bugs)
next build
next start
OR
next build
next export
Context
I wanted to use next.js in order to have a lightning fast site as advertised but no minification kills that. I'm sure I'm missing something simple.
Your Environment
The text was updated successfully, but these errors were encountered: