Giszmo / nostroid

A fast cross platform nostr client that even works offline
https://chat.nostr.info
Other
44 stars 11 forks source link

Fix Circular dependency - or at least make sure it's unproblematic #32

Open Giszmo opened 2 years ago

Giszmo commented 2 years ago

When running pnpm run build, some text (not marked as error or warning) is shown about circular dependencies:

Circular dependency: node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js -> node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js -> node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js
Circular dependency: node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js -> node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_writable.js -> node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js
Circular dependency: node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js -> node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/readable.js -> node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js
Circular dependency: node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js -> node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/writable.js -> node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/readable-stream/duplex.js

This looks like this issue and while the first instance can be solved using hacks described here, these do not solve the second pair of circular dependencies above.

Is this a problem? Do we have to fix it? If so, how?

ralyodio commented 2 years ago

Are we needing readable-streams and are we correctly polyfilling it in vite.config.js?

Giszmo commented 2 years ago

@ralyodio you tell me. This is the kind of issues I need people with more experience for. Being a Svelte/JS-dev only since this project I had no idea what was rollup and I still only have a vague understanding of what polyfilling is.