[Pkg-javascript-devel] Bug#1008789: node-node-sass: autopkgtest needs update for new version of nodejs: require() of ES modules is not supported.

Paul Gevers elbrus at debian.org
Fri Apr 1 18:09:22 BST 2022


Source: node-node-sass
Version: 7.0.1+git20211229.3bb51da+dfsg-1
Severity: serious
X-Debbugs-CC: nodejs at packages.debian.org
Tags: sid bookworm
User: debian-ci at lists.debian.org
Usertags: needs-update
Control: affects -1 src:nodejs

Dear maintainer(s),

With a recent upload of nodejs the autopkgtest of node-node-sass fails 
in testing when that autopkgtest is run with the binary packages of 
nodejs from unstable (even with the rebuild binaries from 
node-node-sass). It passes when run with only packages from testing. In 
tabular form:

                        pass            fail
nodejs                 from testing    16.13.2+really14.19.1~dfsg-6
node-node-sass         from testing    7.0.1+git20211229.3bb51da+dfsg-1
versioned deps [0]     from testing    from unstable
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of nodejs to testing 
[1]. Of course, nodejs shouldn't just break your autopkgtest (or even 
worse, your package), but it seems to me that the change in nodejs was 
intended and your package needs to update to the new situation.

If this is a real problem in your package (and not only in your 
autopkgtest), the right binary package(s) from nodejs should really add 
a versioned Breaks on the unfixed version of (one of your) package(s). 
Note: the Breaks is nice even if the issue is only in the autopkgtest as 
it helps the migration software to figure out the right versions to 
combine in the tests.

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[0] You can see what packages were added from the second line of the log 
file quoted below. The migration software adds source package from 
unstable to the list if they are needed to install packages from 
nodejs/16.13.2+really14.19.1~dfsg-6. I.e. due to versioned dependencies 
or breaks/conflicts.
[1] https://qa.debian.org/excuses.php?package=nodejs

https://ci.debian.net/data/autopkgtest/testing/amd64/n/node-node-sass/20479893/log.gz

# Using ./package.(json|yaml)
# Node module name is node-sass
# Build files found: # Test files found: test
# Found debian/tests/pkg-js/files, let's use it
# Files/dir to be installed from source: test
sass-spec
debian/tests/test_modules
# Copy test files
# Copy debian/tests/pkg-js content
'debian/tests/pkg-js' -> 
'/tmp/autopkgtest-lxc.3dgeerq5/downtmp/autopkgtest_tmp/smokeyoCSIg/debian/tests/pkg-js'
'debian/tests/pkg-js/files' -> 
'/tmp/autopkgtest-lxc.3dgeerq5/downtmp/autopkgtest_tmp/smokeyoCSIg/debian/tests/pkg-js/files'
'debian/tests/pkg-js/test' -> 
'/tmp/autopkgtest-lxc.3dgeerq5/downtmp/autopkgtest_tmp/smokeyoCSIg/debian/tests/pkg-js/test'
Found debian/tests/test_modules
'get-stdin' linked into node_modules
# Searching module in /usr/lib/nodejs/node-sass
# Searching module in /usr/lib/x86_64-linux-gnu/nodejs/node-sass
# Found /usr/lib/x86_64-linux-gnu/nodejs/node-sass
# Searching files to link in /usr/lib/x86_64-linux-gnu/nodejs/node-sass
'./bin' -> '/usr/lib/x86_64-linux-gnu/nodejs/node-sass/bin'
'./lib' -> '/usr/lib/x86_64-linux-gnu/nodejs/node-sass/lib'
# subdir node_modules already exists:
# Searching files to link in 
/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules
'./async-foreach' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/async-foreach'
'./gaze' -> '/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/gaze'
# subdir get-stdin already exists:
# Searching files to link in 
/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/get-stdin
ln: failed to create symbolic link './index.js': File exists
### skipping ln: failed to create symbolic link './package.json': File 
exists
### skipping './js-base64' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/js-base64'
'./sass-graph' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/sass-graph'
'./scss-tokenizer' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/scss-tokenizer'
'./stdout-stream' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/stdout-stream'
'./true-case-path' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/node_modules/true-case-path'
'./package.json' -> 
'/usr/lib/x86_64-linux-gnu/nodejs/node-sass/package.json'
'./scripts' -> '/usr/lib/x86_64-linux-gnu/nodejs/node-sass/scripts'
'./src' -> '/usr/lib/x86_64-linux-gnu/nodejs/node-sass/src'
'./vendor' -> '/usr/lib/x86_64-linux-gnu/nodejs/node-sass/vendor'
# Searching module in /usr/share/nodejs/node-sass
# Launch debian/tests/pkg-js/test with sh -ex
+ ls test/api.js+  test/binding.js test/cli.js test/downloadoptions.js 
test/errors.js test/lowlevel.js test/runtime.js test/types.js 
test/useragent.js test/watcher.js
grep -Ev (cli.js|spec.js)
+ mocha test/api.js test/binding.js test/downloadoptions.js 
test/errors.js test/lowlevel.js test/runtime.js test/types.js 
test/useragent.js test/watcher.js
internal/modules/cjs/loader.js:1102
       throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
       ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: 
/usr/share/nodejs/path-exists/index.js
require() of ES modules is not supported.
require() of /usr/share/nodejs/path-exists/index.js from 
/usr/share/nodejs/find-up/index.js is an ES module file as it is a .js 
file whose nearest parent package.json contains "type": "module" which 
defines all .js files in that package scope as ES modules.
Instead rename /usr/share/nodejs/path-exists/index.js to end in .cjs, 
change the requiring code to use import(), or remove "type": "module" 
from /usr/share/nodejs/path-exists/package.json.

     at new NodeError (internal/errors.js:322:7)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1102:13)
     at Module.load (internal/modules/cjs/loader.js:950:32)
     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
     at Module.require (internal/modules/cjs/loader.js:974:19)
     at require (internal/modules/cjs/helpers.js:101:18)
     at Object.<anonymous> (/usr/share/nodejs/find-up/index.js:4:20)
     at Module._compile (internal/modules/cjs/loader.js:1085:14)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1114:10)
     at Module.load (internal/modules/cjs/loader.js:950:32) {
   code: 'ERR_REQUIRE_ESM'
}
autopkgtest [19:42:26]: test pkg-js-autopkgtest

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20220401/aa99dea6/attachment-0001.sig>


More information about the Pkg-javascript-devel mailing list