Closed justinfagnani closed 5 years ago
One problem here is that I can't inspect the node_modules
folder to directly see any duplication, nor can I use paths into node_modules
for imports to try to work around the problem. Imports like ../node_modules/@polymer/lit-element/node_modules/lit-html/lit-html.js
seem like they are being re-written to strip the leading ../node_modules/
.
Hmmm that's interesting, when looking at the sandbox there doesn't seem to be duplication. A trick to see all files in the sandbox is opening your devtools, pointing to the frame and use the fs API:
BrowserFS.BFSRequire('fs').readdirSync('/node_modules')
You can also inspect the files by doing the same but checking the manager, which is global:
manager.transpiledModules
or
manager.manifest
Do you have a reproducible error I can look into?
Oops, I was using a not-yet-released API, and the result happened to look like what also happens when we get package duplication. Sorry!
Thanks for the BrowserFS tip though!
🐛 bug report
Description of the problem
When depending on a package, and one of its transitive dependencies directly, I'm getting package duplication that causes errors in my program.
How has this issue affected you? What are you trying to accomplish?
instanceof
and other branding checks (module-scoped WeakMaps) are failing because of two versions of the same package. This breaks rendering.Link to sandbox: [https://codesandbox.io/s/oqoowy8q89]()