fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.38k stars 345 forks source link

Parcel issues on npm run build. #1334

Closed aminecmi closed 2 years ago

aminecmi commented 2 years ago

Hello,

I'm trying to install selfoss from scratch. I'm up-to-date with the master branch, and I keep having an issue with parcel.

Here is the error message I keep having.

> @ build /var/www/amine/selfoss/assets
> parcel build index.html opml.html hashpassword.html --dist-dir ../public/ --public-url ./

Error: Unable to deserialize cloned data due to invalid or unsupported version.
    at deserialize (v8.js:343:7)
    at deserialize (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/serializer.js:249:48)
    at loadRequestGraph (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/RequestTracker.js:854:52)
    at async Function.init (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/RequestTracker.js:821:17)
    at async Parcel._init (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/Parcel.js:256:28)
    at async Parcel.run (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/Parcel.js:273:7)
    at async run (/var/www/amine/selfoss/assets/node_modules/parcel/lib/cli.js:374:7)
npm ERR! code ELIFECYCLE

I tried downgrading my npm version from 18 to 16, and then 14, but that didn't work.

Any idea on how to solve this ?

aminecmi commented 2 years ago

On the latest version of npm, the build fails a little later.

🚨 Build failed.

@parcel/optimizer-terser: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer

  Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
  at readWasm (/var/www/amine/selfoss/assets/node_modules/terser/node_modules/source-map/lib/read-wasm.js:8:13)
  at wasm (/var/www/amine/selfoss/assets/node_modules/terser/node_modules/source-map/lib/wasm.js:25:16)
  at /var/www/amine/selfoss/assets/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js:264:14
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async SourceMap (/var/www/amine/selfoss/assets/node_modules/terser/dist/bundle.min.js:19362:20)
  at async minify (/var/www/amine/selfoss/assets/node_modules/terser/dist/bundle.min.js:27714:41)
  at async Object.optimize (/var/www/amine/selfoss/assets/node_modules/@parcel/optimizer-terser/lib/TerserOptimizer.js:131:16)
  at async PackagerRunner.optimize (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/PackagerRunner.js:364:20)
  at async PackagerRunner.getBundleResult (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/PackagerRunner.js:255:15)
  at async PackagerRunner.getBundleInfo (/var/www/amine/selfoss/assets/node_modules/@parcel/core/lib/PackagerRunner.js:239:9)
jtojnar commented 2 years ago

I have seen some serialization issues when there was assets/.parcel-cache from a different Node version (probably a bug in Parcel). Try deleting the directory.

The latter is caused by source-map package not being compatible with latest Node.js, it is possible to work around it with https://github.com/parcel-bundler/parcel/issues/8005#issuecomment-1120149358.

aminecmi commented 2 years ago

Thanks for this.

Everything works now !

jtojnar commented 2 years ago

https://github.com/fossar/selfoss/commit/143eef57f0723eab11f68ba27dff920695428acf bumps the terser that bumps the source-map so hopefully that fixes the second issue.