#1002862 node-prop-types: FTBFS with webpack5: Error: Invalid webpack options

#1002862#5
Date:
2021-12-30 11:17:58 UTC
From:
To:
Hi,

We are starting to build against webpack5 in experimental and the
package needed for local build is webpack and node-webpack-source from
experimental.
During a test rebuild, node-prop-types was found to fail to build in
that situation.

Relevant part (hopefully):

dpkg-buildpackage
-----------------

Command: dpkg-buildpackage --sanitize-env -us -uc -b -rfakeroot
dpkg-buildpackage: info: source package node-prop-types
dpkg-buildpackage: info: source version 15.7.2+~15.7.4-2
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Jonas Smedegaard <dr@jones.dk>
  dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
  debian/rules clean
dh clean
    dh_auto_clean --buildsystem=nodejs
         rm -rf ./node_modules/.cache
         rm -rf types-prop-types/node_modules/.cache
rm ./node_modules/.cache
rm types-prop-types/node_modules/.cache
unlink node_modules/@types/prop-types
    dh_clean
  debian/rules binary
dh binary
    dh_update_autotools_config
    dh_autoreconf
    dh_auto_configure --buildsystem=nodejs
Link node_modules/@types/prop-types -> ../../types-prop-types
    debian/rules override_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
webpack --config debian/webpack.config.js --output-library=PropTypes \
         --entry index.js --output ./prop-types.js --mode development
[webpack-cli] Error: Unknown option '--output'
make[1]: *** [debian/rules:8: override_dh_auto_build] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:5: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit
status 2


The full log is attached to this mail

#1002862#10
Date:
2021-12-30 16:53:34 UTC
From:
To:
https://github.com/webpack/webpack-cli/blob/master/OPTIONS.md lists all
options of webpack 5.

This is probably the new option

#1002862#15
Date:
2021-12-31 10:57:28 UTC
From:
To:
On വ്യാ, ഡിസം 30 2021 at 10:23:34 വൈകു +0530 +0530, Pirate Praveen <praveen@onenetbeyond.org> wrote:
index f0080ab..755a2dc 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Build-Depends:
  , node-object-assign
  , node-react
  , terser
- , webpack (>= 4~)
+ , webpack (>= 5~)
 Standards-Version: 4.6.0
 Vcs-Browser: https://salsa.debian.org/js-team/node-prop-types
 Vcs-Git: https://salsa.debian.org/js-team/node-prop-types.git
diff --git a/debian/rules b/debian/rules
index 42e2d84..c4a964b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,5 +6,5 @@

 override_dh_auto_build:
 	webpack --config debian/webpack.config.js --output-library=PropTypes \
-		--entry index.js --output ./prop-types.js --mode development
+		--entry index.js --output-filename ./prop-types.js --mode development
 	terser prop-types.js -o prop-types.min.js

After making these changes and building with experimental enabled, I
get the following error

webpack --config debian/webpack.config.js --output-library=PropTypes \
	--entry index.js --output-filename ./prop-types.js --mode development
CLI for webpack must be installed.
  webpack-cli (https://github.com/webpack/webpack-cli)

We will use "yarn" to install the CLI via "yarn add -D webpack-cli".
Do you want to install 'webpack-cli' (yes/no): make[1]: ***
[debian/rules:8: override_dh_auto_build] Error 1

Did you embed webpack-cli correctly? May be you need to patch in more
places to find /usr/share/nodejs/webpack-cli

#1002862#20
Date:
2022-01-08 18:42:04 UTC
From:
To:
That's a bit strange because from my end I still get the same error
message after updating webpack version in debian/control file here =>
https://salsa.debian.org/Ayoyimika/node-prop-types/-/tree/master/debian

  debian/rules binary
dh binary
    dh_update_autotools_config
    dh_autoreconf
    dh_auto_configure --buildsystem=nodejs
Link node_modules/@types/prop-types -> ../../types-prop-types
    debian/rules override_dh_auto_build
make[1]: Entering directory
'/home/ayoyimika/debian-js-packaging/prop-types/node-prop-types'
webpack --config debian/webpack.config.js --output-library=PropTypes \
         --entry ./index.js --output-filename ./prop-types.js --mode 
development
asset ./prop-types.js 662 bytes [emitted] (name: main)

ERROR in main
Module not found: Error: Recursion in resolving
Stack:
   undefined:
(/home/ayoyimika/debian-js-packaging/prop-types/node-prop-types) ./index.js

webpack 5.65.0 compiled with 1 error in 176 ms
make[1]: *** [debian/rules:8: override_dh_auto_build] Error 1
make[1]: Leaving directory
'/home/ayoyimika/debian-js-packaging/prop-types/node-prop-types'
make: *** [debian/rules:5: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit
status 2

#1002862#25
Date:
2022-01-08 18:46:26 UTC
From:
To:
After updating node-prop-types to use webpack5 option see repo =>
https://salsa.debian.org/Ayoyimika/node-prop-types/-/tree/master/debian
I get this error log, pls help is needed to try solve this problem.

  debian/rules binary
dh binary
    dh_update_autotools_config
    dh_autoreconf
    dh_auto_configure --buildsystem=nodejs
Link node_modules/@types/prop-types -> ../../types-prop-types
    debian/rules override_dh_auto_build
make[1]: Entering directory
'/home/ayoyimika/debian-js-packaging/prop-types/node-prop-types'
webpack --config debian/webpack.config.js --output-library=PropTypes \
         --entry ./index.js --output-filename ./prop-types.js --mode 
development
asset ./prop-types.js 662 bytes [emitted] (name: main)

ERROR in main
Module not found: Error: Recursion in resolving
Stack:
   undefined:
(/home/ayoyimika/debian-js-packaging/prop-types/node-prop-types) ./index.js

webpack 5.65.0 compiled with 1 error in 204 ms
make[1]: *** [debian/rules:8: override_dh_auto_build] Error 1
make[1]: Leaving directory
'/home/ayoyimika/debian-js-packaging/prop-types/node-prop-types'
make: *** [debian/rules:5: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit
status 2

#1002862#30
Date:
2022-01-26 16:26:30 UTC
From:
To:
Fixing previous prevalent error message affecting many revserse
dependencies of webpack5 and thereafter enabling upstream test lead to
this module babel-preset-react not found error.

A potential fix is for upstream to update its babel-preset-react from
version 6.24.1 to version 7.10.1 where the name also changes from
babel-preset-react to @babel/preset-react

important error log:

    dh_auto_test --buildsystem=nodejs
         ln -s ../. node_modules/prop-types
         /bin/sh -ex debian/tests/pkg-js/test
+ jest
  FAIL  __tests__/PropTypesProductionStandalone-test.js
   ● Test suite failed to run

     Cannot find module 'babel-preset-react'
     Require stack:
     - /usr/share/nodejs/@babel/core/lib/config/files/plugins.js
     - /usr/share/nodejs/@babel/core/lib/config/files/index.js
     - /usr/share/nodejs/@babel/core/lib/index.js
     - /usr/share/nodejs/babel-jest/build/loadBabelConfig.js
     - /usr/share/nodejs/babel-jest/build/index.js
     - /usr/share/nodejs/jest-util/build/requireOrImportModule.js
     - /usr/share/nodejs/jest-util/build/index.js
     - /usr/share/nodejs/jest-resolve/build/resolver.js
     - /usr/share/nodejs/jest-resolve/build/index.js
     - /usr/share/nodejs/jest-runtime/build/index.js
     - /usr/share/nodejs/jest-runner/build/testWorker.js
     - /usr/share/nodejs/jest-worker/build/workers/processChild.js
     - If you want to resolve "react", use "module:react"
     - Did you mean "@babel/react"?

       155 |         f.code = "MODULE_NOT_FOUND";
       156 |         throw f;
     > 157 |       })(id, {
           |         ^
       158 |         paths: [dirname]
       159 |       })
       160 |     };

       at tryRequireResolve
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:157:9)
       at resolveStandardizedNameForRequrie
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:195:17)
       at sync
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:229:12)
       at sync (../../../../../usr/share/nodejs/gensync/index.js:182:19)
       at ../../../../../usr/share/nodejs/gensync/index.js:210:24
       at resolvePreset
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:87:17)
           at resolvePreset.next (<anonymous>)

  FAIL  __tests__/PropTypesDevelopmentStandalone-test.js
   ● Test suite failed to run

     Cannot find module 'babel-preset-react'
     Require stack:
     - /usr/share/nodejs/@babel/core/lib/config/files/plugins.js
     - /usr/share/nodejs/@babel/core/lib/config/files/index.js
     - /usr/share/nodejs/@babel/core/lib/index.js
     - /usr/share/nodejs/babel-jest/build/loadBabelConfig.js
     - /usr/share/nodejs/babel-jest/build/index.js
     - /usr/share/nodejs/jest-util/build/requireOrImportModule.js
     - /usr/share/nodejs/jest-util/build/index.js
     - /usr/share/nodejs/jest-resolve/build/resolver.js
     - /usr/share/nodejs/jest-resolve/build/index.js
     - /usr/share/nodejs/jest-runtime/build/index.js
     - /usr/share/nodejs/jest-runner/build/testWorker.js
     - /usr/share/nodejs/jest-worker/build/workers/processChild.js
     - If you want to resolve "react", use "module:react"
     - Did you mean "@babel/react"?

       155 |         f.code = "MODULE_NOT_FOUND";
       156 |         throw f;
     > 157 |       })(id, {
           |         ^
       158 |         paths: [dirname]
       159 |       })
       160 |     };

       at tryRequireResolve
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:157:9)
       at resolveStandardizedNameForRequrie
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:195:17)
       at sync
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:229:12)
       at sync (../../../../../usr/share/nodejs/gensync/index.js:182:19)
       at ../../../../../usr/share/nodejs/gensync/index.js:210:24
       at resolvePreset
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:87:17)
           at resolvePreset.next (<anonymous>)

  FAIL  __tests__/PropTypesDevelopmentReact15.js
   ● Test suite failed to run

     Cannot find module 'babel-preset-react'
     Require stack:
     - /usr/share/nodejs/@babel/core/lib/config/files/plugins.js
     - /usr/share/nodejs/@babel/core/lib/config/files/index.js
     - /usr/share/nodejs/@babel/core/lib/index.js
     - /usr/share/nodejs/babel-jest/build/loadBabelConfig.js
     - /usr/share/nodejs/babel-jest/build/index.js
     - /usr/share/nodejs/jest-util/build/requireOrImportModule.js
     - /usr/share/nodejs/jest-util/build/index.js
     - /usr/share/nodejs/jest-resolve/build/resolver.js
     - /usr/share/nodejs/jest-resolve/build/index.js
     - /usr/share/nodejs/jest-runtime/build/index.js
     - /usr/share/nodejs/jest-runner/build/testWorker.js
     - /usr/share/nodejs/jest-worker/build/workers/processChild.js
     - If you want to resolve "react", use "module:react"
     - Did you mean "@babel/react"?

       155 |         f.code = "MODULE_NOT_FOUND";
       156 |         throw f;
     > 157 |       })(id, {
           |         ^
       158 |         paths: [dirname]
       159 |       })
       160 |     };

       at tryRequireResolve
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:157:9)
       at resolveStandardizedNameForRequrie
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:195:17)
       at sync
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:229:12)
       at sync (../../../../../usr/share/nodejs/gensync/index.js:182:19)
       at ../../../../../usr/share/nodejs/gensync/index.js:210:24
       at resolvePreset
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:87:17)
           at resolvePreset.next (<anonymous>)

  FAIL  __tests__/PropTypesProductionReact15-test.js
   ● Test suite failed to run

     Cannot find module 'babel-preset-react'
     Require stack:
     - /usr/share/nodejs/@babel/core/lib/config/files/plugins.js
     - /usr/share/nodejs/@babel/core/lib/config/files/index.js
     - /usr/share/nodejs/@babel/core/lib/index.js
     - /usr/share/nodejs/babel-jest/build/loadBabelConfig.js
     - /usr/share/nodejs/babel-jest/build/index.js
     - /usr/share/nodejs/jest-util/build/requireOrImportModule.js
     - /usr/share/nodejs/jest-util/build/index.js
     - /usr/share/nodejs/jest-resolve/build/resolver.js
     - /usr/share/nodejs/jest-resolve/build/index.js
     - /usr/share/nodejs/jest-runtime/build/index.js
     - /usr/share/nodejs/jest-runner/build/testWorker.js
     - /usr/share/nodejs/jest-worker/build/workers/processChild.js
     - If you want to resolve "react", use "module:react"
     - Did you mean "@babel/react"?

       155 |         f.code = "MODULE_NOT_FOUND";
       156 |         throw f;
     > 157 |       })(id, {
           |         ^
       158 |         paths: [dirname]
       159 |       })
       160 |     };

       at tryRequireResolve
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:157:9)
       at resolveStandardizedNameForRequrie
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:195:17)
       at sync
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:229:12)
       at sync (../../../../../usr/share/nodejs/gensync/index.js:182:19)
       at ../../../../../usr/share/nodejs/gensync/index.js:210:24
       at resolvePreset
(../../../../../usr/share/nodejs/@babel/core/lib/config/files/plugins.js:87:17)
           at resolvePreset.next (<anonymous>)

Test Suites: 4 failed, 4 total
Tests:       0 total
Snapshots:   0 total
Time:        4.665 s
Ran all test suites.
dh_auto_test: error: /bin/sh -ex debian/tests/pkg-js/test returned exit
code 1

#1002862#37
Date:
2022-05-31 12:49:30 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
node-prop-types, 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 1002862@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Yadd <yadd@debian.org> (supplier of updated node-prop-types 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: Tue, 31 May 2022 14:28:48 +0200
Source: node-prop-types
Architecture: source
Version: 15.8.1+~15.7.5-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Changed-By: Yadd <yadd@debian.org>
Closes: 1002862
Changes:
 node-prop-types (15.8.1+~15.7.5-1) unstable; urgency=medium
 .
   * Team upload
 .
   [ Ayoyimika Ajibade ]
   * New upstream version 15.8.1+~15.7.4
   * Update build command to webpack5
   * Added lintian-overrides
   * Enabled Upstream test
   * properly configure test
   * fix spyOn error
   * migrate to jest 27.4.7
   * rebase test command
   * fix console error
 .
   [ Yadd ]
   * Update typescript definitions
   * Declare compliance with policy 4.6.1
   * New upstream version 15.8.1+~15.7.5
   * Build with node-browserify (Closes: #1002862)
   * Drop test (needs an outdated jest)
Checksums-Sha1:
 793e9bf73c43f6990d7b6b834673e15b87ca2f7f 2528 node-prop-types_15.8.1+~15.7.5-1.dsc
 5f19d2b85a98e9558036f6a3cacc8819420f05cf 2656 node-prop-types_15.8.1+~15.7.5.orig-types-prop-types.tar.gz
 da25529abc0af4e08ad413fe65e82b44f1493b40 96121 node-prop-types_15.8.1+~15.7.5.orig.tar.gz
 1327a5e075112c319aa10f0f01f6fd332291dff6 6856 node-prop-types_15.8.1+~15.7.5-1.debian.tar.xz
Checksums-Sha256:
 294241aed7f167bbfb8f082e22feaac3ed03167f71dd827c5da5c39601aa7613 2528 node-prop-types_15.8.1+~15.7.5-1.dsc
 419d6d3356a2aee9a5a1d24e623c5236970655e3e7c66ed30328a8b2aad42ea0 2656 node-prop-types_15.8.1+~15.7.5.orig-types-prop-types.tar.gz
 2a929c784f43f8088bf0b8cc5cce817e7b9b505faeec3ad3cd71f3ae8f2b8019 96121 node-prop-types_15.8.1+~15.7.5.orig.tar.gz
 c0eab8126ea45ecb562e3a8a16f9bf1aee96c9bf034436697e8e3aa8961a3b54 6856 node-prop-types_15.8.1+~15.7.5-1.debian.tar.xz
Files:
 019425d21bf52e1c702f4678fe354283 2528 javascript optional node-prop-types_15.8.1+~15.7.5-1.dsc
 6a8624fcaa01fea72420106f21a7c67d 2656 javascript optional node-prop-types_15.8.1+~15.7.5.orig-types-prop-types.tar.gz
 aff2e5785e3b160d2f69f486b18f63dd 96121 javascript optional node-prop-types_15.8.1+~15.7.5.orig.tar.gz
 b20e7a84fafb8f8269413acff24659b1 6856 javascript optional node-prop-types_15.8.1+~15.7.5-1.debian.tar.xz
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEAN/li4tVV3nRAF7J9tdMp8mZ7ukFAmKWCpIACgkQ9tdMp8mZ
7unB8w//T2Grdtzv6L9lTvRm9/kATO7uBGmovCepjTve5krEtL9FChG8/zKRTMYO
Fm9ik19ThRPLqFYiR+eHw96DLaTupNDVVOcAU5sPAIA2sUoC4q1QNWFnSlwHzRv8
SwBLkjtVnJ5TU7NLFDxkH5bXzn/U73a5JRzrbVKHOE6yw1j5RVHlrByDg5aN9rvv
fcxNoq/c//2LZgR3GHFWEQIuZrupHUrDSItxSpV70kIOf7y/+pNf3kwD1CckhF2q
LSrgqDEy/gLUp+wHvU6Kbq1NsDo6LFAICervt3sYcVoPuaM7PwvMYR0qlxozE7Kk
07juf8qPl2ozG1Xsa/dzAA1iAnmMkRuWBIfsjUgSdqdYS/+blxfl+6P41mukOmW9
Q10k7xajITC8j98teJakKnyMHrG/zyPLC+eV1qNJDMYF/PrVHx5I9m6Sy1+lZZxY
OOgI5WVdI7keoboMrurDpCILQ4QqLlOxYsAG61f1bHUaMqdHEWHXTJw8R/gF+6bb
5yqbZYo5gNDnsqKKdUSK7rw1GMgRfR3fmkFTjJARl+e0mUEXf+jj0SCtGMm9KU35
wC8/X6jdHN6C72q1oKJ0Fa39JYovqwpiVGwFE1zzQ17X4BsaYVdAKMIW2/lkFgiH
EU7uEK2OcBov2lFACa4IcaLFCcL2KCH09OuYt78GbGqSQ8Ar1jU=
=m7jX
-----END PGP SIGNATURE-----