-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Debug placeholders replaced with colors in production #21489
Labels
Milestone
Comments
apeatling
modified the milestones:
Product Quality,
Product Quality: “How’s my site doing?” Flows
Jan 31, 2018
apeatling
removed
[Pri] Normal
Schedule for the next available opportuinity.
[Pri] Low
Address when resources are available.
labels
Feb 1, 2018
Naïvely tried upgrading these modules with no success:
|
I've narrowed this down to uglification. With this patch, I no longer see the issue in Docker builds: diff --git a/webpack.config.js b/webpack.config.js
index fcdf23efa5..61655855cc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -31,9 +31,7 @@ const config = require( './server/config' );
const calypsoEnv = config( 'env_id' );
const bundleEnv = config( 'env' );
const isDevelopment = bundleEnv === 'development';
-const shouldMinify = process.env.hasOwnProperty( 'MINIFY_JS' )
- ? process.env.MINIFY_JS === 'true'
- : ! isDevelopment;
+const shouldMinify = false;
// load in the babel config from babelrc and disable commonjs transform
// this enables static analysis from webpack including treeshaking |
Uglify compress is the culprit. With this patch there's no issue: diff --git a/webpack.config.js b/webpack.config.js
index fcdf23efa5..d77beea979 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -295,7 +295,7 @@ if ( shouldMinify ) {
new UglifyJsPlugin( {
cache: 'docker' !== process.env.CONTAINER,
parallel: true,
- uglifyOptions: { ecma: 5 },
+ uglifyOptions: { compress: false, ecma: 5 },
sourceMap: Boolean( process.env.SOURCEMAP ),
} )
); |
This was referenced Mar 16, 2018
Closed
Seems to be a bug in |
You two. Amazing detective work! 🔍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
NODE_ENV === 'production'
builds, the%s
string placeholder can be observed being replaced with colors rather than the provided value. I haven't verified whether other placeholders work as expected.Steps to reproduce
What I expected
%s
should be replaced by the provided arguments.What happened instead
%s
is replaced by what appears to be the color for the current debug instance.Screenshot / Video
Dev
Prod
Context / Source
Spotted while shipping #21104 which led to workaround #21390
/cc @samouri (#12841)
The text was updated successfully, but these errors were encountered: