'Bit react-typescript compiler with material-ui

I started playing around with microservices/microfrontends and started using Bit.dev

Bit provides a react-typescript compiler. Using that I tried to compile a piece of code from the Material-UI GitHub (create-react-app-with-styled-components-typescript)

Said compiler works great if the code I have has nothing imported from material-ui, however - and my problem is here -: If material ui is used, the compiler throws:

Cannot find module '@emotion/styled' or its corresponding type declarations.

Cannot find module '@emotion/react' or its corresponding type declarations.

I tried npm installing these packages, tried to declare them as module, nothing seems to be working.

The only workaround I have found is to create JSX files from TSX, using TSC, and then simply use the react compiler from Bit.



Sources

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

Source: Stack Overflow

Solution Source