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

Plugin no longer transforming codebase as of v1.10.3

Open frisbee09 opened this issue 4 years ago • 4 comments

Just updated from v1.10.0 to v1.10.6 and finding the plugin no longer transforming any of my code. I managed to get it to kick back in by downgrading to v1.10.2.

My snapshots capture this by failing with these kinds of mismatches,

 -           "componentId": "ComponentName___default-sc-15na3pr-0", /// v1.10.2 with RHL
 +           "componentId": "ComponentName-sc-15na3pr-0", //v1.10.2 without RHL
 +           "componentId": "sc-bdVaJa", //v1.10.3+

If it helps debug the issue, I can confirm that the ___default injection appears when react-hot-loader/babel is enabled. Removing react-hot-loader from the plugin chain doesn't make [email protected] transform any of my code, however.

Babel configuration looks like this:

{
	"plugins": [
		"babel-plugin-styled-components",
		"@babel/plugin-proposal-class-properties",
		"@babel/plugin-transform-runtime",
		"@babel/plugin-transform-object-assign",
		"@babel/plugin-proposal-throw-expressions",
		"@babel/plugin-transform-react-constant-elements",
		"react-hot-loader/babel"
	],
	"presets": [
		[
			"@babel/preset-env",
			{
				"targets": {
					"ie": "11"
				}
			}
		],
		"@babel/preset-react",
		"@babel/preset-typescript"
	]
}

Sorry if this is a bad bug report? I'm not used to opening GitHub issues. Could this be related to @babel/plugin-proposal-dynamic-import becoming part of @babel/core as of v7.5.0?

frisbee09 avatar Aug 27 '19 11:08 frisbee09

👍 We are seeing the same issue

AndyBan avatar Sep 11 '19 09:09 AndyBan

Same issue with version 1.10.6, everything works with 1.10.5. .babelrc content:

{
    "presets": ["@babel/env"],
    "plugins": [
        [
            "babel-plugin-styled-components",
            {
                "minify": true,
                "transpileTemplateLiterals": true,
                "fileName": false,
                "displayName": true,
                "ssr": false
            }
        ]
    ]
}

ppiyush13 avatar Sep 22 '19 15:09 ppiyush13

Same issue here.

Shakeskeyboarde avatar Nov 24 '19 02:11 Shakeskeyboarde

There is a potential fix for you in #261 @ChrisAckerman @AndyBan @ppiyush13

frisbee09 avatar Nov 29 '19 14:11 frisbee09