[Pkg-javascript-devel] Bug#1026688: leaflet: FTBFS: SyntaxError: Cannot use import statement outside a module

Lucas Nussbaum lucas at debian.org
Tue Dec 20 17:40:40 GMT 2022


Source: leaflet
Version: 1.7.1~dfsg-6
Severity: serious
Justification: FTBFS
Tags: bookworm sid ftbfs
User: lucas at debian.org
Usertags: ftbfs-20221220 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>>'
> NODE_ENV=release rollup --config build/rollup-config.js
> (node:1087360) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
> (Use `node --trace-warnings ...` to show where the warning was created)
> [!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.
> 
> Original error: Cannot use import statement outside a module
> https://rollupjs.org/guide/en/#--bundleconfigascjs
> /<<PKGBUILDDIR>>/build/rollup-config.js:3
> import json from '@rollup/plugin-json'
> ^^^^^^
> 
> SyntaxError: Cannot use import statement outside a module
>     at Object.compileFunction (node:vm:360:18)
>     at wrapSafe (node:internal/modules/cjs/loader:1088:15)
>     at Module._compile (node:internal/modules/cjs/loader:1123:27)
>     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
>     at Module.load (node:internal/modules/cjs/loader:1037:32)
>     at Module._load (node:internal/modules/cjs/loader:878:12)
>     at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
>     at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
>     at async Promise.all (index 0)
>     at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
> 
> 
> make[1]: *** [debian/rules:30: dist/leaflet-src.esm.js] Error 1


The full build log is available from:
http://qa-logs.debian.net/2022/12/20/leaflet_1.7.1~dfsg-6_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20221220;users=lucas@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20221220&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 mark 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