You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2017/12/01 14:49:28 UTC
[GitHub] thijsfranck opened a new issue #3973: uglifyjs-webpack-plugin@^0.4.6 and uglifyjs-webpack-plugin@^1.1.0 both in use
thijsfranck opened a new issue #3973: uglifyjs-webpack-plugin@^0.4.6 and uglifyjs-webpack-plugin@^1.1.0 both in use
URL: https://github.com/apache/incubator-superset/issues/3973
- [x] I have checked the superset logs for python stacktraces and included it here as text if any
- [x] I have reproduced the issue with at least the latest released version of superset
- [x] I have checked the issue tracker for the same issue and I haven't found one similar
### Superset version
commit 84a7730 - master branch
### Expected results
Compile javascript containing ES6 constructs successfully using uglifyjs-webpack-plugin^1.1.2
### Actual results
UglifyJs produces the following errors:
`ERROR in dashboard.ec6c8da707d118e14e39.entry.js from UglifyJs
Unexpected token: punc (.) [dashboard.ec6c8da707d118e14e39.entry.js:266806,11]
ERROR in explore.4ffc79b5c4308af98750.entry.js from UglifyJs
Unexpected token: punc (.) explore.4ffc79b5c4308af98750.entry.js:266286,11]`
### Steps to reproduce
The first error is being caused by this line of code:
`if (new.target == ConceptRegistry) {`
The second error is being caused by this line of code (it's actually the same):
`if (new.target == ConceptRegistry) {`
This code runs just fine, but the uglification script is having some trouble with it. I expect this is because this syntax was only introduced recently (ES6). The uglification plugin version 1.0.0 and up should support this. The latest version of superset has version 1.1.0 configured. In my problem solving process, I have upgraded this to version 1.1.2 to see if this changes things (it does not). Thus, the package.json is set up as follows:
`devdependencies{
"uglifyjs-webpack-plugin": "^1.1.2"
}`
However, in the yarn.lock file I am finding this:
`uglifyjs-webpack-plugin@^0.4.6:
version "0.4.6"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
dependencies:
source-map "^0.5.6"
uglify-js "^2.8.29"
webpack-sources "^1.0.1"
uglifyjs-webpack-plugin@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.1.2.tgz#8a9abc238d01a33daaf86fa9a84c7ebc1e67b0f9"
dependencies:
cacache "^10.0.0"
find-cache-dir "^1.0.0"
schema-utils "^0.3.0"
source-map "^0.6.1"
uglify-es "^3.2.0"
webpack-sources "^1.0.1"
worker-farm "^1.4.1"`
So, there is a dependency to the new version of the uglification plugin, which supports my syntax, and an older version which does not. Since I am seeing errors, I am guessing the latter one is used at the moment. I have not yet found the configuration setting that is managing this. Is this behaviour intentional, or is this a bug? Where can I find the additional configuration that I am currently still missing?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services