debugging tips for pnp #2875
-
In the past, I would often debug issues I had with dependencies by inspecting and sometimes editing node modules directly (such as adding console.log statements). This was always a helpful way to understand what my scripts were doing under the hood and has been a useful way to fix many issues in the past. My biggest concern about migrating my project to pnp is that that seems like it will be much more difficult going forward, since all of the dependencies are in zip files instead. Are there common practices/tools to help debug node modules when your project uses pnp? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
By having the ZipFS extension installed, you'll be able to click on symbols to go to definition inside the archives and you'll also be able to right-click on an archive to mount it. Once you're inside a file, you'll be able to edit and save it and PnP will use the modified version. Yarn will also throw a You can also do Finally, if you still consider the editor experience subpar, you can continue using |
Beta Was this translation helpful? Give feedback.
By having the ZipFS extension installed, you'll be able to click on symbols to go to definition inside the archives and you'll also be able to right-click on an archive to mount it. Once you're inside a file, you'll be able to edit and save it and PnP will use the modified version.
Yarn will also throw a
CACHE_CHECKSUM_MISMATCH
error on installs if you edit an archive and forget to revert it. You can then runYARN_CHECKSUM_BEHAVIOR=reset yarn
to have Yarn fetch the archive again.You can also do
yarn unplug -AR '**/*'
to unplug everything for local development and then revert those changes before you commit (we've discussed about having a way foryarn unplug
not to persist the changes, bu…