Tailwind-Styled-Component icon indicating copy to clipboard operation
Tailwind-Styled-Component copied to clipboard

TypeError: default is not a function

Open alexjidras opened this issue 1 year ago • 2 comments

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 avatar Dec 12 '22 15:12 alexjidras

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

As a temporary fix i aliased the module. image

alexjidras avatar Dec 13 '22 12:12 alexjidras

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

Kadrian avatar Feb 23 '23 08:02 Kadrian