[Pkg-javascript-devel] Bug#1007267: node-eslint-scope: FTBFS while updating with webpack5: Error: Invalid webpack options

Ayoyimika Ajibade ayoyimikaajibade at gmail.com
Tue Mar 15 07:20:26 GMT 2022


Source: node-eslint-scope
Version:  7.1.1
Severity: normal
Justification: ftbfs
Tags: ftbfs
User: pkg-javascript-devel at alioth-lists.debian.net
Usertags: webpack5

Hi,

While building one of webpack5 reverse dependencies 
node-stats-webpack-plugin as this also affect most webpack reverse 
dependencies its throws and error about a module not exported properly.

Full error log here =>

    dh_auto_test --buildsystem=nodejs
         mkdir -p node_modules
         ln -s ../. node_modules/stats-webpack-plugin
         /bin/sh -ex debian/tests/pkg-js/test
+ mocha -R spec --timeout=30000


   StatsWebpackPlugin
     1) generates `stats.json` file
     2) supports multi-compile mode and outputs one `stats.json` file


   0 passing (754ms)
   2 failing

   1) StatsWebpackPlugin
        generates `stats.json` file:
      Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath 
'./lib/referencer' is not defined by "exports" in 
/usr/share/nodejs/eslint-scope/package.json
       at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
       at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
       at resolveExports (internal/modules/cjs/loader.js:424:36)
       at Function.Module._findPath (internal/modules/cjs/loader.js:464:31)
       at Function.Module._resolveFilename 
(internal/modules/cjs/loader.js:802:27)
       at Function.Module._load (internal/modules/cjs/loader.js:667:27)
       at Module.require (internal/modules/cjs/loader.js:887:19)
       at require (internal/modules/cjs/helpers.js:74:18)
       at Object.<anonymous> 
(/usr/share/nodejs/webpack/lib/optimize/ConcatenatedModule.js:9:20)
       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 Module.require (internal/modules/cjs/loader.js:887:19)
       at require (internal/modules/cjs/helpers.js:74:18)
       at Object.<anonymous> 
(/usr/share/nodejs/webpack/lib/optimize/ModuleConcatenationPlugin.js:21:28)
       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 Module.require (internal/modules/cjs/loader.js:887:19)
       at require (internal/modules/cjs/helpers.js:74:18)
       at WebpackOptionsApply.process 
(/usr/share/nodejs/webpack/lib/WebpackOptionsApply.js:388:38)
       at createCompiler (/usr/share/nodejs/webpack/lib/webpack.js:80:28)
       at create (/usr/share/nodejs/webpack/lib/webpack.js:134:16)
       at webpack (/usr/share/nodejs/webpack/lib/webpack.js:158:32)
       at f (/usr/share/nodejs/webpack/lib/index.js:58:16)
       at Context.<anonymous> (test/plugin.js:73:20)
       at callFnAsync (/usr/share/nodejs/mocha/lib/runnable.js:394:21)
       at Test.Runnable.run (/usr/share/nodejs/mocha/lib/runnable.js:338:7)
       at Runner.runTest (/usr/share/nodejs/mocha/lib/runner.js:678:10)
       at /usr/share/nodejs/mocha/lib/runner.js:801:12
       at next (/usr/share/nodejs/mocha/lib/runner.js:593:14)
       at /usr/share/nodejs/mocha/lib/runner.js:603:7
       at next (/usr/share/nodejs/mocha/lib/runner.js:486:14)
       at cbHookRun (/usr/share/nodejs/mocha/lib/runner.js:551:7)
       at done (/usr/share/nodejs/mocha/lib/runnable.js:310:5)
       at callFn (/usr/share/nodejs/mocha/lib/runnable.js:389:7)
       at Hook.Runnable.run (/usr/share/nodejs/mocha/lib/runnable.js:354:5)
       at next (/usr/share/nodejs/mocha/lib/runner.js:510:10)
       at Immediate._onImmediate 
(/usr/share/nodejs/mocha/lib/runner.js:571:5)
       at processImmediate (internal/timers.js:461:21)

   2) StatsWebpackPlugin
        supports multi-compile mode and outputs one `stats.json` file:
      Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath 
'./lib/referencer' is not defined by "exports" in 
/usr/share/nodejs/eslint-scope/package.json
       at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
       at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
       at resolveExports (internal/modules/cjs/loader.js:424:36)
       at Function.Module._findPath (internal/modules/cjs/loader.js:464:31)
       at Function.Module._resolveFilename 
(internal/modules/cjs/loader.js:802:27)
       at Function.Module._load (internal/modules/cjs/loader.js:667:27)
       at Module.require (internal/modules/cjs/loader.js:887:19)
       at require (internal/modules/cjs/helpers.js:74:18)
       at Object.<anonymous> 
(/usr/share/nodejs/webpack/lib/optimize/ConcatenatedModule.js:9:20)
       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 Module.require (internal/modules/cjs/loader.js:887:19)
       at require (internal/modules/cjs/helpers.js:74:18)
       at Object.<anonymous> 
(/usr/share/nodejs/webpack/lib/optimize/ModuleConcatenationPlugin.js:21:28)
       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 Module.require (internal/modules/cjs/loader.js:887:19)
       at require (internal/modules/cjs/helpers.js:74:18)
       at WebpackOptionsApply.process 
(/usr/share/nodejs/webpack/lib/WebpackOptionsApply.js:388:38)
       at createCompiler (/usr/share/nodejs/webpack/lib/webpack.js:80:28)
       at /usr/share/nodejs/webpack/lib/webpack.js:44:48
       at Array.map (<anonymous>)
       at createMultiCompiler 
(/usr/share/nodejs/webpack/lib/webpack.js:44:33)
       at create (/usr/share/nodejs/webpack/lib/webpack.js:125:16)
       at webpack (/usr/share/nodejs/webpack/lib/webpack.js:158:32)
       at f (/usr/share/nodejs/webpack/lib/index.js:58:16)
       at Context.<anonymous> (test/plugin.js:89:20)
       at callFnAsync (/usr/share/nodejs/mocha/lib/runnable.js:394:21)
       at Test.Runnable.run (/usr/share/nodejs/mocha/lib/runnable.js:338:7)
       at Runner.runTest (/usr/share/nodejs/mocha/lib/runner.js:678:10)
       at /usr/share/nodejs/mocha/lib/runner.js:801:12
       at next (/usr/share/nodejs/mocha/lib/runner.js:593:14)
       at /usr/share/nodejs/mocha/lib/runner.js:603:7
       at next (/usr/share/nodejs/mocha/lib/runner.js:486:14)
       at cbHookRun (/usr/share/nodejs/mocha/lib/runner.js:551:7)
       at done (/usr/share/nodejs/mocha/lib/runnable.js:310:5)
       at callFn (/usr/share/nodejs/mocha/lib/runnable.js:389:7)
       at Hook.Runnable.run (/usr/share/nodejs/mocha/lib/runnable.js:354:5)
       at next (/usr/share/nodejs/mocha/lib/runner.js:510:10)
       at Immediate._onImmediate 
(/usr/share/nodejs/mocha/lib/runner.js:571:5)
       at processImmediate (internal/timers.js:461:21)



dh_auto_test: error: /bin/sh -ex debian/tests/pkg-js/test returned exit 
code 2
make: *** [debian/rules:8: binary] Error 255
dpkg-buildpackage: error: debian/rules binary subprocess returned exit 
status 2


so i decided to fix the error and also update node-eslint-scope, While 
updating node-eslint-scope from version 5.1.1 to 7.1.1 its fails to 
build with sbuild as the actual problem is in nodejs itself
Debian's nodejs include a patch to look for modules in /usr/share/nodejs 
but this only work for commonjs modules and not for ES modules and 
typescript.
I think the actual problem is that the dependency of node-eslint-scope 
node-espree cannot detect its own dependency node-acorn which is also in 
the node_modules directory.
here is a link to the repo: 
https://salsa.debian.org/Ayoyimika/node-eslint-scope
and a link to the bug report i filed

Here is the important log output of failing build with sbuild =>

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

Command: dpkg-buildpackage --sanitize-env -us -uc -b -rfakeroot
dpkg-buildpackage: info: source package node-eslint-scope
dpkg-buildpackage: info: source version 7.1.1-1
dpkg-buildpackage: info: source distribution experimental
dpkg-buildpackage: info: source changed by Ayoyimika Ajibade 
<ayoyimikaajibade at gmail.com>
  dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
  debian/rules clean
dh clean
    debian/rules override_dh_clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_clean -- README.html README.txt CHANGELOG.html CHANGELOG.txt
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
  debian/rules binary
dh binary
    dh_update_autotools_config
    dh_autoreconf
    debian/rules override_dh_auto_build
make[1]: Entering directory '/<<PKGBUILDDIR>>'
pandoc --from gfm-raw_html --to html --standalone --output README.html 
README.md
[WARNING] This document format requires a nonempty <title> element.
   Defaulting to 'README' as the title.
   To specify a title, use 'title' in metadata or --metadata title="...".
pandoc --from gfm-raw_html --to plain --output README.txt README.md
pandoc --from gfm-raw_html --to html --standalone --output 
CHANGELOG.html CHANGELOG.md
[WARNING] This document format requires a nonempty <title> element.
   Defaulting to 'CHANGELOG' as the title.
   To specify a title, use 'title' in metadata or --metadata title="...".
pandoc --from gfm-raw_html --to plain --output CHANGELOG.txt CHANGELOG.md
rollup -c

./lib/index.js → dist/eslint-scope.cjs...
created dist/eslint-scope.cjs in 526ms
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
    debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
mkdir ./node_modules
ln -s /usr/share/nodejs/chai/  ./node_modules/
ln -s /usr/share/nodejs/espree ./node_modules/
ln -s /usr/share/nodejs/estraverse ./node_modules/
ln -s /usr/share/nodejs/esrecurse ./node_modules/
ln -s /usr/share/nodejs/eslint-visitor-keys ./node_modules/
ln -s /usr/share/nodejs/acorn ./node_modules/
ln -s /usr/share/nodejs/acorn-jsx ./node_modules/
mocha --reporter tap tests/arguments.js tests/catch-scope.js 
tests/child-visitor-keys.js tests/class-fields.js 
tests/class-static-blocks.js tests/es6-arrow-function-expression.js 
tests/es6-block-scope.js tests/es6-catch.js tests/es6-class.js 
tests/es6-default-parameters.js tests/es6-destructuring-assignments.js 
tests/es6-export.js tests/es6-import.js tests/es6-iteration-scope.js 
tests/es6-new-target.js tests/es6-object.js tests/es6-rest-args.js 
tests/es6-super.js tests/es6-switch.js tests/es6-template-literal.js 
tests/export-star-as-ns-from-source.js tests/fallback.js 
tests/function-expression-name.js tests/get-declared-variables.js 
tests/global-increment.js tests/implicit-global-reference.js 
tests/implied-strict.js tests/label.js tests/nodejs-scope.js 
tests/object-expression.js tests/optimistic.js tests/references.js 
tests/use-strict.js tests/with-scope.js

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'acorn' imported from 
/usr/share/nodejs/espree/espree.js
Did you mean to import acorn/dist/acorn.js?
     at packageResolve (internal/modules/esm/resolve.js:664:9)
     at moduleResolve (internal/modules/esm/resolve.js:705:18)
     at Loader.defaultResolve [as _resolve] 
(internal/modules/esm/resolve.js:798:11)
     at Loader.resolve (internal/modules/esm/loader.js:100:40)
     at Loader.getModuleJob (internal/modules/esm/loader.js:246:28)
     at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:47:40)
     at link (internal/modules/esm/module_job.js:46:36)
make[1]: *** [debian/rules:44: override_dh_auto_test] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:21: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit 
status 2
--------------------------------------------------------------------------------
Build finished at 2022-03-15T06:41:17Z

Finished
--------


+------------------------------------------------------------------------------+
| Cleanup 
       |
+------------------------------------------------------------------------------+

Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Build failure (dpkg-buildpackage died)

+------------------------------------------------------------------------------+
| Summary 
       |
+------------------------------------------------------------------------------+

Build Architecture: amd64
Build Type: binary
Build-Space: 860
Build-Time: 5
Distribution: experimental
Fail-Stage: build
Host Architecture: amd64
Install-Time: 18
Job: 
/home/ayoyimika/debian-js-packaging/eslint-scope/node-eslint-scope_7.1.1-1.dsc
Machine Architecture: amd64
Package: node-eslint-scope
Package-Time: 158
Source-Version: 7.1.1-1
Space: 860
Status: attempted
Version: 7.1.1-1
--------------------------------------------------------------------------------
Finished at 2022-03-15T06:41:17Z
Build needed 00:02:38, 860k disk space
E: Build failure (dpkg-buildpackage died)

Pls assistance is needed to help me debug and find solution. Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x1FF1115A4CAC464D.asc
Type: application/pgp-keys
Size: 3151 bytes
Desc: OpenPGP public key
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20220315/2bf14cc8/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20220315/2bf14cc8/attachment.sig>


More information about the Pkg-javascript-devel mailing list