coracle-social / coracle

An experimental Nostr client focused on unlocking the full potential of multiple relays. Browse, filter, zap, and create custom feeds to create a curated Nostr experience.
https://app.coracle.social
MIT License
283 stars 70 forks source link

Missing platform-specific optional `rollup` and `sharp` packages after latest commit #441

Closed yamdan closed 2 weeks ago

yamdan commented 2 weeks ago

Hi, thank you very much for publishing such a great Nostr client!

I noticed that the latest commit (8c6226ecfa1b5b8d5102f08e6c660d5919378fdc) removes all platform-specific optional rollup and sharp packages except for rollup-darwin-arm64 in package-lock.json. As a result, I encountered the following runtime error in my devcontainer environment (linux-x64-gnu). Could we consider restoring the removed options if possible?

$ npm run dev

> coracle@0.4.10 dev
> vite --host

/workspaces/coracle/node_modules/rollup/dist/native.js:59
                throw new Error(
                      ^

Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/workspaces/coracle/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/workspaces/coracle/node_modules/rollup/dist/native.js:68:76)
    at Module._compile (node:internal/modules/cjs/loader:1467:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
    at Module.load (node:internal/modules/cjs/loader:1282:32)
    at Module._load (node:internal/modules/cjs/loader:1098:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at cjsLoader (node:internal/modules/esm/translators:318:5)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:258:7) {
  [cause]: Error: Cannot find module '@rollup/rollup-linux-x64-gnu'
  Require stack:
  - /workspaces/coracle/node_modules/rollup/dist/native.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1219:15)
      at Module._load (node:internal/modules/cjs/loader:1045:27)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
      at Module.require (node:internal/modules/cjs/loader:1304:12)
      at require (node:internal/modules/helpers:123:16)
      at requireWithFriendlyError (/workspaces/coracle/node_modules/rollup/dist/native.js:41:10)
      at Object.<anonymous> (/workspaces/coracle/node_modules/rollup/dist/native.js:68:76)
      at Module._compile (node:internal/modules/cjs/loader:1467:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1551:10) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/workspaces/coracle/node_modules/rollup/dist/native.js' ]
  }
}

Node.js v22.4.0
staab commented 2 weeks ago

Thanks for opening the issue, I had noticed it as well but wasn't sure how I broke it. I've added optional deps for sharp, rollup, and esbuild back in.