babel-plugin-styled-components icon indicating copy to clipboard operation
babel-plugin-styled-components copied to clipboard

Vite + babel-plugin-styled-components throws

Open eldar-mekhraliev opened this issue 2 years ago • 3 comments

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

eldar-mekhraliev avatar Jun 26 '23 11:06 eldar-mekhraliev

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.

ovidiuwin avatar Oct 12 '23 11:10 ovidiuwin

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.

bambery avatar Jan 23 '24 03:01 bambery

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,
            },
          ],
        ],
      },
    }),

lu-zen avatar Mar 07 '24 17:03 lu-zen