MathiasGilson / Tailwind-Styled-Component

Create Tailwind CSS React components like styled components with class names on multiple lines and conditional class rendering
MIT License
818 stars 43 forks source link

TypeError: default is not a function #83

Open alexjidras opened 1 year ago

alexjidras commented 1 year ago
image

I'm getting this in vitest jsdom tests. All the tests that import a file that contains a tw component fail with this error, regardless of tw(xxx) or tw.xxx.

alexjidras commented 1 year ago

@MathiasGilson changing package.json's "main" to .esm solves the problem.

As a temporary fix i aliased the module.

image
Kadrian commented 1 year ago

This also helped me make tailwind-styled-components work when using Astro (astro build)