I'm using a library called yjs that needs to be imported just once, across all dependencies. Currently, when I run my app, I get the following warning message from yjs:
Yjs was already imported. Importing different versions of Yjs often leads to issues.
How can I see what is importing this library, and where the double-import might be coming from?
When I run pnpm why yjs it tells me a little info:
$ pnpm why yjs
Legend: production dependency, optional only, dev only
relm-server@1.0.0 /home/duane/Relm/relm/server
dependencies:
y-websocket 1.3.18-canadaduane
├─┬ y-leveldb 0.1.1
│ └── yjs 13.5.27 peer
└── yjs 13.5.27 peer
yjs 13.5.27
But it isn't showing me some of the places that I know are also importing yjs. For example, this project has several pnpm workspaces, and other workspaces that use yjs are dependencies of this one--but they aren't visible in the pnpm why report.
Is there a way to "print" a log of import statements as the app runs, and show what js files are importing what packages/files?