-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
False warning message starting from version 5.15.3 (you are running a minified build, but 'process.end.NODE_ENV'...
)
#2266
Comments
Related to #2264 Thanks for the report. Can you please describe your environment? This has happened mostly by accident when merging a code base (#2248). But the intention is actually good. The That is true for |
@FredyC, see also my comment on the PR, using the .min. by default just exposes the opposite problem: getting minified code while devving that lacks the assertions that are especially build for dev I? I think we should stick to the old setup, where you get the 'dev' version by default, unless you configure your bundler to substitute for prod, and make sure nothing dies if there is no substitution at all |
Yea, I think we will go the way TSDX does, by exposing if (process.env.NODE_ENV === 'production') {
module.exports = require('./mobx.min.js')
} else {
module.exports = require('./mobx.js')
} This way the correct bundle will be selected depending if you are developing or bundling for a production. |
@FredyC We are using The problem is in the published file When opening its contents, you'll see that there is a |
Ah yes, you are right, module bundle should be left untouched because it is handled by the bundler. That's definitely a mistake I will fix. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions. |
The Problem
On version
[email protected]
the bundlemobx.module.js
throws an error which is a false positive. It says that the bundler was not configured for production which in fact it was.This is a degradation from
[email protected]
where there was no such message.Explanation
Digging into the build process of mobx i've found this change which did the following replacement
mobx/src/v5/mobx.ts
Line 42 in d5488a1
It makes mobx send this message in case the code passed minification regardless of the
process.env.NODE_ENV
that was used during build time. Sending a false message to the user.Possible Solution
While the replacement is good for optimizing production bundles, for development it is not critical. Removing this line should remove this warning. If we would like to optimize the development bundle we can later on see how we can do it without sending the false warning.
The text was updated successfully, but these errors were encountered: