'@emotion/styled in PNPM monorepo

I'm using MUI with @emotion/styled in PNPM monorepo. Since there's only one instance of @emotion/styled because of the way PNPM is handling symlinks, ThemeProvider in JEST is not passing themes correctly to deep children.

Is it possible to disable symlinks only for @emotion/styled in PNPM? I cannot use node-linker=pnp in my repository.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source