You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NodeJS usage should be possible. This became an issue following a comment from one of the vite maintainers in this thread: vitest-dev/vitest#5286 (reply in thread).
importstyledfrom'styled-components';console.log('keys:',Object.keys(styled));console.log('styled.h1',styled.h1);// undefinedconsole.log('styled.default.h1',styled.default.h1);// function
The text was updated successfully, but these errors were encountered:
I came here from the issue on vitest repo.
The NodeJS usage is important for vitest to run with styled-components, since vitest run in the context of node.
The workaround from the vitest issue that worked also for me is to add the private package that depends on styled-components to test.server.deps.inline:
Environment
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-mt2ebd?file=repro.mjs
Steps to reproduce
The reproduction is on the stackblitz link
Expected Behavior
NodeJS usage should be possible. This became an issue following a comment from one of the vite maintainers in this thread: vitest-dev/vitest#5286 (reply in thread).
Another useful link that shows the problem: https://publint.dev/styled-components@6.1.8
Actual Behavior
The text was updated successfully, but these errors were encountered: