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

new version causes compile error

Open rafaeldwan opened this issue 7 years ago • 5 comments

the bump to 1.10.3 caused a compile error on our app -

    TypeError: /.../src/components/.../index.jsx: x is not a function
    at .../node_modules/babel-plugin-styled-components/lib/visitors/transpileCssProp.js:117:19```

Rolling back to 1.10.2 fixed the issue. 

rafaeldwan avatar Jun 28 '19 00:06 rafaeldwan

Hmm. Do you have some babel 6 stuff lingering around in your app? The only thing I can think of that might trigger this is the addition of https://github.com/styled-components/babel-plugin-styled-components/blob/9c4f19f104789299a4d7c4216a1abd0dbfb55bd1/src/visitors/transpileCssProp.js#L132

If an old version of babel types is being used that type function might not exist.

quantizor avatar Jun 28 '19 00:06 quantizor

Can you try out 1.10.4? I added a filter to make sure the function exists before checking it.

quantizor avatar Jun 28 '19 00:06 quantizor

yes, looks like most of our babel stuff is at ^6.x Testing 1.10.4 now

rafaeldwan avatar Jun 28 '19 00:06 rafaeldwan

Compiled successfully. Thank you for the prompt fix!

rafaeldwan avatar Jun 28 '19 00:06 rafaeldwan

Awesome, glad to hear it!

quantizor avatar Jun 28 '19 00:06 quantizor