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

Vite + babel-plugin-styled-components throws #396

Open
eldar-mekhraliev opened this issue Jun 26, 2023 · 3 comments
Open

Vite + babel-plugin-styled-components throws #396

eldar-mekhraliev opened this issue Jun 26, 2023 · 3 comments

Comments

@eldar-mekhraliev
Copy link

Hello, the problem seem to be related to wrapping svg Icons with styled-components, but it is very hard to follow.

I know this is not much for investigating, but i cant seem to find the proper stack.

Uncaught TypeError: Unable to determine current node version
at versionIncluded (index.js:51:9)

image
@ovidiuwin
Copy link

Maybe it's not the case but when I bumped into this error it was because I didn't have twin.macro installed properly in the project. In my case I had a storybook app and tried to use twin.macro inside that but I didn't have twin.macro installed. Very weird error message though.

@bambery
Copy link

bambery commented Jan 23, 2024

How are you getting the plugin to work at all in vite? The most recent resolution I see in the other, longer Vite thread is to run very old versions of styled-components, which I am not willing to do. I just get Error: The following dependencies are imported but could not be resolved: styled-components/macro and I've rather given up on readable class names during debugging.

@lu-zen
Copy link

lu-zen commented Mar 7, 2024

Is this plugin supposed to work without macros? on vite it doesn't (SC v6 + plugin)
This does nothing:

 plugins: [
    react({
      babel: {
        plugins: [
          [
            'styled-components',
            {
              displayName: true,
            },
          ],
        ],
      },
    }),

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

4 participants