Skip to content

Commit c9023b8

Browse files
LaurentClaesclaude
andcommitted
Fix _css undefined error by replacing babel-plugin-emotion with @emotion/babel-plugin
babel-plugin-emotion v10 is incompatible with @babel/helper-module-imports v7.28+, causing css/cx imports to be silently dropped from compiled output. Switch to @emotion/babel-plugin v11 which properly handles @emotion/css imports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5ac293d commit c9023b8

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ module.exports = function(api) {
1919
];
2020

2121
const plugins = [
22-
...(isTest ? [] : [['babel-plugin-emotion', {
22+
...(isTest ? [] : [['@emotion/babel-plugin', {
2323
sourceMap: false,
24-
autoLabel: true,
24+
autoLabel: 'dev-only',
2525
labelFormat: '[filename]__[local]',
2626
}]]),
2727
...(isTest ? [] : ['babel-plugin-codegen']),

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"@drawbotics/check-env": "^3.0.0",
6363
"@drawbotics/s3sync": "^1.0.1",
6464
"@drawbotics/use-screen-size": "^3.0.1",
65+
"@emotion/babel-plugin": "^11.13.5",
6566
"@emotion/core": "^10.0.21",
6667
"@emotion/jest": "^11.14.0",
6768
"@mdx-js/loader": "^1.6.21",
@@ -86,8 +87,8 @@
8687
"chalk": "^2.4.2",
8788
"chokidar-cli": "^2.1.0",
8889
"concurrently": "^9.0.0",
89-
"core-js": "^3.0.0",
9090
"copy-webpack-plugin": "^14.0.0",
91+
"core-js": "^3.0.0",
9192
"css-loader": "^7.0.0",
9293
"emotion": "10.0.27",
9394
"empty-module": "^0.0.2",

0 commit comments

Comments
 (0)