[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1023334: Issue confirmed.



A little bit of experimentation indicates that this is an issue.  If I remove 
the embedded copy of rollup and use the system copy, then it fails to build 
because the config file is in the wrong format.

./src/3rdparty/chromium/third_party/devtools-frontend/src/front_end/
rollup.config.js

There are a number of other rollup config files that might also be problematic.

./src/3rdparty/chromium/third_party/devtools-frontend/src/front_end/
third_party/codemirror/package/rollup.config.js
./src/3rdparty/chromium/third_party/devtools-frontend/src/front_end/
third_party/acorn-numeric-separator/package/rollup.config.js
./src/3rdparty/chromium/third_party/devtools-frontend/src/front_end/
third_party/acorn-logical-assignment/package/rollup.config.js
./src/3rdparty/chromium/third_party/perfetto/ui/rollup.config.js
./src/3rdparty/chromium/third_party/SPIRV-Tools/src/tools/sva/rollup.config.js
./src/3rdparty/chromium/v8/tools/turbolizer/rollup.config.js

A segment from the build log:

RuntimeError: ['/usr/bin/nodejs', '../../3rdparty/chromium/third_party/
devtools-frontend/src/node_modules/rollup/dist/bin/rollup', '--silent', '--
plugin', 'terser', '--config', '../../3rdparty/chromium/third_party/devtools-
frontend/src/front_end/rollup.config.js', '--input', 'gen/third_party/devtools-
frontend/src/front_end/dom_extension/dom_extension.prebundle.js', '--file', 
'gen/third_party/devtools-frontend/src/front_end/dom_extension/
dom_extension.js'] failed: b'(node:417155) Warning: To load an ES module, set 
"type": "module" in the package.json or use the .mjs extension.\n(Use `nodejs 
--trace-warnings ...` to show where the warning was created)
\n\x1b[1m\x1b[31m[!] \x1b[1mRollupError: 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.\n\nOriginal error: 
Cannot use import statement outside a 
module\x1b[22m\x1b[1m\x1b[39m\x1b[22m\n\x1b[36mhttps://rollupjs.org/command-line-interface/#bundleconfigascjs\x1b[39m\n\x1b[2m/<<PKGBUILDDIR>>/src/
3rdparty/chromium/third_party/devtools-frontend/src/front_end/rollup.config.js:
5\nimport * as path from \'path\';\n^^^^^^\n\nSyntaxError: Cannot use import 
statement outside a module\n    at internalCompileFunction (node:internal/vm:
74:18)\n    at wrapSafe (node:internal/modules/cjs/loader:1141:20)\n    at 
Module._compile (node:internal/modules/cjs/loader:1182:27)\n    at 
Object.Module._extensions..js (node:internal/modules/cjs/loader:1272:10)\n    
at Module.load (node:internal/modules/cjs/loader:1081:32)\n    at 
Function.Module._load (node:internal/modules/cjs/loader:922:12)\n    at 
ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)\n    at 
ModuleJob.run (node:internal/modules/esm/module_job:194:25)\x1b[22m\n\n\n’


At this point, I am going to take a look at the upstream Chromium and see if 
it is still a problem there.  If so, I will file a bug with them.

-- 
Soren Stoutner
soren@stoutner.com

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: