Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redundant imports cause default-export version to not be transformed #392

Open
gregorjan opened this issue May 26, 2023 · 1 comment
Open

Comments

@gregorjan
Copy link

gregorjan commented May 26, 2023

When using named import from styled-components both babel and swc plugins are not used.

image

Funnily enough in codesandbox the behavior is exact opposite

Environment

System:

  • OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
  • CPU: (2) x64 AMD EPYC
  • Memory: 617.30 MB / 2.01 GB
  • Container: Yes
  • Shell: 5.8 - /bin/zsh

Binaries:

  • Node: 18.15.0 - /usr/local/bin/node
  • Yarn: 1.22.19 - /usr/local/bin/yarn
  • npm: 9.5.0 - /usr/local/bin/npm

npmPackages:

  • babel-plugin-styled-components: ^2.1.3 => 2.1.3
  • styled-components: ^6.0.0-rc.2 => 6.0.0-rc.2-4007

Reproduction

https://codesandbox.io/p/sandbox/jolly-haze-sf21k4

Steps to reproduce

Use babel-plugin-styled-components and named import from styled-components package

Expected Behavior

displayName is correctly added to class

Actual Behavior

displayName is not added to class

@quantizor
Copy link
Collaborator

When using named import from styled-components both babel and swc plugins are not used.

Actually looking at your sandbox, it looks like only the button using the named import worked... I wonder if the plugin can handle one or the other but not both.

@quantizor quantizor changed the title When using named import from styled-components both babel and swc plugins are ignored. redundant imports cause default-export version to not be transformed Jun 23, 2023
@quantizor quantizor transferred this issue from styled-components/styled-components Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants