-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a document about pnpm monorepo error
- Loading branch information
Showing
1 changed file
with
7 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Incorrect package deduping for compat addons in pnpm | ||
|
||
As part of the process of rewriting v1 addons there is a type of de-duplication that is affectionalty called "smooshing". This prevents there from being many instances of old v1 addons in an embroider build. | ||
|
||
With this process there can be a rare case where it doesn't act as required. For example, if you're using pnpm in a monorepo and there are multiple packages that have similar peer dependencies you can sometimes fall into an issue where the code for smooshing gets confused. This is because it uses the exact folder location for a dependency as a key in the v1 addon cache (you can see more [in this file](https://github.com/embroider-build/embroider/blob/main/packages/compat/src/build-compat-addon.ts)) but pnpm duplicates dependency trees that have any differences in subdependencies and has different file locations for these duplicates. You can read more about this in the pnpm docs: https://pnpm.io/how-peers-are-resolved | ||
|
||
The solution to this issue `dependenciesMeta.*.injected` for the shared monorepo package which will prevent there from being an extra duplicate tree created in the dependencies. You can read more about this config in the pnpm documentation https://pnpm.io/package_json#dependenciesmetainjected |