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

Sebastiaan Couwenberg sebastic at xs4all.nl
Wed Dec 28 11:06:39 GMT 2022


On Tue, 20 Dec 2022 18:40:40 +0100 Lucas Nussbaum wrote:
> > 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'
> > ^^^^^^

Upstream seems to have fixed this by updating the plugin:

  https://github.com/Leaflet/Leaflet/pull/8721

The relevant commit in rollup/plugins seems to be:

 
https://github.com/rollup/plugins/commit/445f8ca88c7a903b14601a7bc9e0bf9d9436413d

Kind Regards,

Bas

-- 
  GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1



More information about the Pkg-javascript-devel mailing list