[Pkg-javascript-devel] Bug#1011885: node-define-lazy-prop: FTBFS: ReferenceError: require is not defined in ES module scope, you can use import instead
Lucas Nussbaum
lucas at debian.org
Thu May 26 20:10:25 BST 2022
Source: node-define-lazy-prop
Version: 3.0.0-4
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lucas at debian.org
Usertags: ftbfs-20220525 ftbfs-bookworm
Hi,
During a rebuild of all packages in sid, your package failed to build
on amd64.
Relevant part (hopefully):
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> mjs2cjs -a
> Not found
> xo not found in nodejs directories
> Not found
> tsd not found in nodejs directories
> Not found
> ava not found in nodejs directories
> [36m
> [1m./index.js[22m → [1m./dhnodejsBundle.cjs[22m...[39m
> [1m[33m(!) Entry module "index.js" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "index.js" to use named exports only.[39m[22m
> [90mhttps://rollupjs.org/guide/en/#outputexports[39m
> [1mindex.js[22m
> [32mcreated [1m./dhnodejsBundle.cjs[22m in [1m20ms[22m[39m
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> dh_auto_test --buildsystem=nodejs
> ln -s ../. node_modules/define-lazy-prop
> /bin/sh -ex debian/tests/pkg-js/test
> + tape test.js
> file:///<<PKGBUILDDIR>>/test.js:1
> const test = require('tape');
> ^
>
> ReferenceError: require is not defined in ES module scope, you can use import instead
> This file is being treated as an ES module because it has a '.js' file extension and '/<<PKGBUILDDIR>>/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
> at file:///<<PKGBUILDDIR>>/test.js:1:14
> at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
> at async Promise.all (index 0)
> at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
> at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
> dh_auto_test: error: /bin/sh -ex debian/tests/pkg-js/test returned exit code 1
The full build log is available from:
http://qa-logs.debian.net/2022/05/25/node-define-lazy-prop_3.0.0-4_unstable.log
All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20220525;users=lucas@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20220525&fusertaguser=lucas@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results
A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects
If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.
More information about the Pkg-javascript-devel
mailing list