styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.27k stars 107 forks source link

TS error when trying to export xstyled with added utilities #391

Closed yahor-ramanenka-op closed 1 year ago

yahor-ramanenka-op commented 1 year ago

🐛 Bug Report

TS error Exported variable 'styled' has or is using name 'XStyled' from external module "file:///node_modules/@xstyled/styled-components/dist/index" but cannot be named. when trying to export return value from createCss

To Reproduce

Steps to reproduce the behavior:

  1. Follow the guide on adding utilities https://xstyled.dev/docs/adding-new-utilities/
  2. Try to export {styled};
  3. Get an error.

Expected behavior

No typescript error

Link to repl or repo (highly encouraged)

Typescript playground with issue

Run npx envinfo --system --binaries --npmPackages @xstyled/system,@xstyled/styled-components,styled-components --markdown --clipboard

## System:
 - OS: macOS 13.0.1
 - CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
 - Memory: 1.68 GB / 16.00 GB
 - Shell: 5.8.1 - /bin/zsh
## Binaries:
 - Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
 - Yarn: 1.22.19 - ~/.yarn/bin/yarn
 - npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
## npmPackages:
 - @xstyled/styled-components: ^3.7.0 => 3.7.0 
 - styled-components: ^5.3.5 => 5.3.5 
AhmedAymanOptio commented 1 year ago

@gregberge are there any plans to release this fix? :)