- Package:
- node-terser
- Source:
- node-terser
- Submitter:
- Pirate Praveen
- Date:
- 2022-06-07 08:09:03 UTC
- Severity:
- wishlist
terser-webpack-plugin needs terser at least version 4.8. Is there any known blockers I can help with?
Quoting Pirate Praveen (2021-05-14 13:46:28)
Draft package in git fails like this:
cd dist && ../bin/terser \
--mangle --compress \
--source-map 'content=bundle.js.map,includeSources=true' \
--output bundle.min.js \
-- bundle.js
Parse error at undefined:undefined,undefined
/build/node-terser-4.8.0/bin/terser:244
var lines = files[ex.filename].split(/\r?\n/);
^
TypeError: Cannot read property 'split' of undefined
at run (/build/node-terser-4.8.0/bin/terser:244:44)
at Object.<anonymous> (/build/node-terser-4.8.0/bin/terser:188:5)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
/build/node-terser-4.8.0/tools/exit.js:14
throw exit;
^
[Function: exit]
I suspect it is related to patch 1001 to use commander 4 - would sure be
helpful to have a pair of fresh eyes on it.
- Jonas
Le 14/05/2021 à 14:21, Jonas Smedegaard a écrit : Hi, same error with and without 1001 patch
Le 15/05/2021 à 05:13, Yadd a écrit : No bundle.js it's a valid minified file
Le 15/05/2021 à 05:02, Yadd a écrit :
$ cd /tmp
$ npm i terser@4.8.0
$ cd -
$ cd dist && /tmp/node_modules/terser/bin/terser \
--mangle --compress \
--source-map 'content=bundle.js.map,includeSources=true' \
--output bundle.min.js \
-- bundle.js
Looking more, error seems to be in `rollup --no-esModule -c`: the
produced files looks strange (a mix of js and map)
Hi there. I realized a step in the build was executing the terser mangle and compress commands against the build output ( bundle.min.js ) . I considered we don't need this step as we don't have to be executing the library against itself, so I made a change in debian/rules that seems to fix #988507. With this fix, the build works fine as it should and all the necessary binaries generated. Please find it at: https://salsa.debian.org/sonnie/node-terser/-/commit/e380c31cf6c323807860d4caf439b8c954cb1d72Kindly review this fix so I can proceed with fix for #988508 which we need for #980316 . RegardsSunday
Hi Sunny, Quoting Sonnie Nkwuda (2021-06-13 20:17:18) Yes! Thanks a lot - that was indeed the problem. - Jonas
We believe that the bug you reported is fixed in the latest version of
node-terser, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 988507@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Jonas Smedegaard <dr@jones.dk> (supplier of updated node-terser package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 13 Jun 2021 23:45:33 +0200
Source: node-terser
Binary: libjs-terser node-terser terser
Architecture: source all
Version: 4.8.0-1
Distribution: experimental
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Changed-By: Jonas Smedegaard <dr@jones.dk>
Description:
libjs-terser - parser/mangler/compressor for ES6+ - browser library
node-terser - parser/mangler/compressor for ES6+ - Node.js library
terser - parser/mangler/compressor for ES6+ - CLI tool
Closes: 988507
Changes:
node-terser (4.8.0-1) experimental; urgency=medium
.
[ upstream ]
* new release(s)
+ closes: bug#988507
.
[ Jonas Smedegaard ]
* update git-buildpackage settings:
+ use DEP-14 git branch names
* modernize source script copyright-check
* use brotli compression suffix .brotli
(not .br used for language breton)
* declare compliance with Debian Policy 4.5.1
* set Rules-Requires-Root: no
* build-depend on node-rollup-plugin-terser
* fix manpage description
* update build routines;
build-depend on eslint
* fix stop depend on nodejs
* have libjs-terser recommend libjs-source-map
* have libjs-terser depend on node-terser
(not the other way around),
to avoid node-terser transitively recommending javascript-common
* update patches
* add patch 2002 to avoid nodejs module astring
* copyright: update coverage
* fix stop build bundle.js,
thanks to Sonnie Nkwuda (see bug#988507)
* provide binary package terser (not uglifyjs.terser);
have node-terser break uglifyjs.terser and suggest terser
* use debhelper compatibility level 13 (not 12)
* update lintian override
Checksums-Sha1:
b9f2bd543029eb4345602dc41959dc3b295758cf 2392 node-terser_4.8.0-1.dsc
ab88b672cd5b71b5d39c3516fc676a1fcd0a0723 430663 node-terser_4.8.0.orig.tar.gz
4aaf349d9ffea05d0049995fff94a7949f23f0dd 10628 node-terser_4.8.0-1.debian.tar.xz
926338a6d312d96771ba41966ea6dcb8d15bd0e0 505128 libjs-terser_4.8.0-1_all.deb
8b0576c341b51fe5a5b57c73c5848eaeb102ac39 251516 node-terser_4.8.0-1_all.deb
37004aa4544174dbd91049889aa99ada1f8e0dce 14566 node-terser_4.8.0-1_amd64.buildinfo
73f3120c36d0447f8df3f49031539e8569a35bc3 15800 terser_4.8.0-1_all.deb
Checksums-Sha256:
e1f42fd5624f4d2c880db620685f2ffae31846bebe01b97d29db42907e8009e7 2392 node-terser_4.8.0-1.dsc
d43a691f7e836595f2bbce1d052d9996bfff486957c19ebb6b9f0b53a7c7b832 430663 node-terser_4.8.0.orig.tar.gz
aee44311b37e051d80fa79a1f5794f2ed4f0a9cff3f10ebeb6eac424ce042083 10628 node-terser_4.8.0-1.debian.tar.xz
1de5e13e34b91ad3b5bc8cd97982ab650736d5a680b7760aba312af0b1fc3e85 505128 libjs-terser_4.8.0-1_all.deb
9be66c005c580fada8dfd014fb01fb5696c2858cebb9e7ac60851f58f984d7fc 251516 node-terser_4.8.0-1_all.deb
8b9c0969370c114e3b21644bfefcbd7f3cf3238d23cee115d3560a4f3e4f5dfb 14566 node-terser_4.8.0-1_amd64.buildinfo
8afea1ca78e6e6af25ebcc9bf07518f70c84cf00ff498e2e4e00efc29fcb414c 15800 terser_4.8.0-1_all.deb
Files:
d44cc36193e3a2d2caf568ab4f683e5d 2392 javascript optional node-terser_4.8.0-1.dsc
7f8b49249d6e1b94e5d5fe77c6d89cf5 430663 javascript optional node-terser_4.8.0.orig.tar.gz
9f14a24686291790321c88960c154884 10628 javascript optional node-terser_4.8.0-1.debian.tar.xz
29bb28833d6019359842dd8dbc2476ab 505128 javascript optional libjs-terser_4.8.0-1_all.deb
a7155f81da8444fe3b46d07aaabd3288 251516 javascript optional node-terser_4.8.0-1_all.deb
715bceca66023b9804bbdf383b1d5ede 14566 javascript optional node-terser_4.8.0-1_amd64.buildinfo
e14af93bf70805711de85ac23b5e365e 15800 javascript optional terser_4.8.0-1_all.deb
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmDGhoIACgkQLHwxRsGg
ASFUsw/8Co1H4ddDw7TKgMMn/w/14Yl9Iinaq7GtT/9dgOHRAaDxHJPw95YJErHo
pUeTozKk04mcn3Q9tVOZew+t2xChZVl60UwAVDsPTPqRJKDipYbe77C84mxbTSfu
0clbzJu2YhBgulqHy35lOB7MOrxotkmdQS/fb4Aa/WE6NmU9rkQePxPHu7iBuoei
aVrMTb+yTljt0DBwjtEJo5hE2G7V6sZ2aM/ZyYTlQQaDboBhiMjh/lroPOUwY2w3
0Q4iSZkKuAgh1RtW6b9Mb2vfFCWO6a4OQImYbqiw88cXFsYB5HfClnM91nAu2d4r
z6Bz82tRioAaO6ojnD1gXrUehRQgsk/dYJ3stU9H/JOS9S6a3balvVGr4x2jLlmR
Rk5zEaqWPPqwMC2Wc9QSuauF6wh8anU3vORxwvrBwdx5UXe+53ymGbDy7x8Bo3Rb
5wVftLwbfggus94tt8b2TGL1dYuxvxOyI4uB3FkocCIyo27NrFINNQjbd/n0lrKG
Nsus2JwvbayWqm0OkgUBcuxTNRjiKS76wQn+n/sOxaa219nFuaaxOm3ke891cPAu
Uj3x+qYIjrFSAx4iCQqL7KMCHeKETmAU1jKaL0tSQbS7z42bVI+eMk4r+FjFHGHw
qxbIlheRI3QxCL7NdXFoPgNCMKWHcxe21xjmRRZTvpEKZdzAv4s=
=fH0G
-----END PGP SIGNATURE-----
One known blocker for upgrading terser is that the executable has
changed name. I should have adjusted all packages in the Javascript
team and filed bugreports against packages outside the team, and now in
theory all packages should succesfully build with terser v4.8 available
in experimental.
Next step in upgrading terser to v4.8 is to test if that theory holds
true. I have not found time for testing that for some time, and also
don't have the experience in that task so I guess others in the team are
more efficient in doing it than me.
So consider this an invitation to help modernizing terser package:
1. Test-build all reverse-build-dependencies of terser
in a build environment with experimental terser 4.8.0-1 installed
2a. if many builds fail, report that to 988507@bugs.debian.org
2b. if few builds fail, file bugreport against those packages
3. report summary of tests made to 988507@bugs.debian.org
Thanks for considering!
- Jonas
P.S. If noone else does this, I will do it myself at some point, just
not sure when...
Quoting Jonas Smedegaard (2022-02-06 12:26:08) - Jonas
On Sun, 06 Feb 2022 12:26:08 +0100 Jonas Smedegaard <dr@jones.dk> wrote: > One known blocker for upgrading terser is that the executable has > changed name. I should have adjusted all packages in the Javascript > team and filed bugreports against packages outside the team, and now in > theory all packages should succesfully build with terser v4.8 available > in experimental. > > Next step in upgrading terser to v4.8 is to test if that theory holds > true. I have not found time for testing that for some time, and also > don't have the experience in that task so I guess others in the team are > more efficient in doing it than me. > > So consider this an invitation to help modernizing terser package: > > 1. Test-build all reverse-build-dependencies of terser > in a build environment with experimental terser 4.8.0-1 installed > 2a. if many builds fail, report that to 988507@bugs.debian.org > 2b. if few builds fail, file bugreport against those packages > 3. report summary of tests made to 988507@bugs.debian.org Ruby team has automated scripts for doing this. https://salsa.debian.org/ruby-team/meta setup script creates chroots for sbuild and lxc and then build script prompts if we should test (rebuild using sbuild and autopkgtest using lxc or schroot) any reverse (build) dependencies. We can choose the list of packages to test and it will give a report after testing all the selected packages. I have been using this for all major updates (for ruby as well as js packages) and I highly recommend using these scripts. I think Jeremy also has something similar using gitlab ci, created for nodejs rebuilds. We will have to provide a custom gitlab runner machine for that I think (as salsa ci default runners don't support such mass rebuilds). While running this I noticed this autopkgtest error (fails also on ci.debian.net). This probably needs an autopkgtest dependency on nodejs. autopkgtest [15:56:55]: test command1: node -e "require('terser');" autopkgtest [15:56:55]: test command1: [----------------------- bash: line 1: node: command not found autopkgtest [15:56:55]: test command1: -----------------------] command1 FAIL non-zero exit status 127 autopkgtest [15:56:56]: test command1: - - - - - - - - - - results - - - - - - - - - - autopkgtest [15:56:56]: test command1: - - - - - - - - - - stderr - - - - - - - - - - bash: line 1: node: command not found and I have started a test of all reverse (build) dependencies, ======================================================================== = Found reverse runtime, build, or test dependencies that can be tested! ======================================================================== autopkgtest ----------- node-rollup node-uglifyjs-webpack-plugin node-rollup-plugin-terser ruby-terser rebuild ------- almond node-ipaddr.js impress.js node-is-stream janus node-istanbul jquery-coolfieldset node-jmespath jquery-lazyload node-jquery-textcomplete jquery-reflection node-jschardet jquery-watermark node-markdown-it jsxgraph node-markdown-it-html5-embed leaflet node-marked leaflet-markercluster node-md5-hex less.js node-mem node-base64-js node-mermaid node-bootstrap-switch node-prismjs node-chai node-prop-types node-chance node-ramda node-chart.js node-rollup-plugin-terser node-configstore node-shiny-server-client node-core-js node-slice-ansi node-create-react-class node-sockjs-client node-d3-force node-tap node-d3-queue node-thenby node-dagre-d3-renderer node-timeago.js node-dagre-layout node-ua-parser-js node-dateformat node-uglifyjs-webpack-plugin node-dot-prop node-uvu node-es6-promise node-vue-resource node-events node-wrap-ansi node-fecha popper.js node-find-up psl.js node-flatted ruby-rails-assets-jquery-nicescroll node-formidable theano node-fuzzaldrin-plus twitter-bootstrap4 node-graphlibrary underscore node-has-ansi vue-router.js node-i18next-http-backend vue.js Which tests to run: [A(all)/e(dit list)]/s(kip all)] ======================================================================== = Testing reverse (build) dependencies ======================================================================== rebuild almond ... Once the rebuilds and autopkgtests are complete, I will report back the results here.
fix this and retry the full rebuilds to get a better status),
terser -o debian/impress.min.js js/impress.js
/usr/share/nodejs/terser/bin/terser:153
if (~opts.rawArgs.indexOf("--rename")) {
^
TypeError: Cannot read properties of undefined (reading 'indexOf')
at Object.<anonymous> (/usr/share/nodejs/terser/bin/terser:153:19)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js
(node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain]
(node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
and some
node-chai:
uglifyjs.terser : Depends: node-terser (= 4.1.2-10) but it is not
going to be installed
It is coming from one of these packages still depending on
uglifyjs.terser instead of terser.
$ reverse-depends -b uglifyjs.terser
Reverse-Testsuite-Triggers
* node-babel7
Reverse-Build-Depends
* node-babel7
* node-big-integer
* node-webpack
Reverse-Build-Depends-Indep
* wims
pravi@mahishi:~$ reverse-depends uglifyjs.terser
Reverse-Depends
* webpack
Packages without architectures listed are reverse-dependencies in: all,
amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
Since at least one package passed, I will wait for the whole tests to
complete.
rebuild node-chart.js ... PASS
experimental.
(debian-sid)pravi@mahishi:/tmp$ terser -o test.min.js test.js
/usr/share/nodejs/terser/bin/terser:153
if (~opts.rawArgs.indexOf("--rename")) {
^
TypeError: Cannot read properties of undefined (reading 'indexOf')
at Object.<anonymous> (/usr/share/nodejs/terser/bin/terser:153:19)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js
(node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain]
(node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
/usr/share/nodejs/terser/tools/exit.js:14
throw exit;
^
[Function: exit]
(debian-sid)pravi@mahishi:/tmp$ cat test.js
console.log("Hello, World")
It's an error in commander patch, should be:
if (~program.rawArgs.indexOf("--rename")) {
chai already build-depends on terser; not uglify.terser
Thanks, hope Jonas will upload a fix and I will try rebuilds again later. yes, it also build depends on webpack which pulls this. I shared the full list of packages build depending on uglifyjs.terser in a previous reply.
already build-depends on terser
Sorry, I used a bad "grep -E". To be fixed: libjs-fetch node-bootstrap-switch node-chance node-commander node-d3-color node-dagre-d3-renderer node-dagre-layout node-graphlibrary node-jmespath node-jquery-textcomplete node-lunr node-markdown-it-html5-embed node-natural-sort node-terser node-vue-template-compiler node-webpack popper.js psl.js twitter-bootstrap5 vue.js
be able to recompile babel-standalone (and then push this fix)