{"record":{"id":"6d682260b0876f01","repo":"emotion-js/emotion","slug":"the-runtime-option-has-been-removed-if-you-want","errorCode":null,"errorMessage":"The `runtime` option has been removed. If you want to configure `runtime: \"automatic\"`, replace `@emotion/babel-preset-css-prop` with `@babel/preset-react` and `@emotion/babel-plugin`. You can find out how to configure things properly here: https://emotion.sh/docs/css-prop#babel-preset","messagePattern":"The `runtime` option has been removed\\. If you want to configure `runtime: \"automatic\"`, replace `@emotion/babel-preset-css-prop` with `@babel/preset-react` and `@emotion/babel-plugin`\\. You can find out how to configure things properly here: https://emotion\\.sh/docs/css-prop#babel-preset","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/babel-preset-css-prop/src/index.js","lineNumber":17,"sourceCode":"import jsx from '@babel/plugin-transform-react-jsx'\nimport pragmatic from '@emotion/babel-plugin-jsx-pragmatic'\nimport emotion from '@emotion/babel-plugin'\n\nlet pragmaName = '___EmotionJSX'\n\n// pull out the emotion options and pass everything else to the jsx transformer\n// this means if @babel/plugin-transform-react-jsx adds more options, it'll just work\n// and if @emotion/babel-plugin adds more options we can add them since this lives in\n// the same repo as @emotion/babel-plugin\n\nexport default (\n  api,\n  { pragma, sourceMap, autoLabel, labelFormat, importMap, ...options } = {}\n) => {\n  if (options.runtime) {\n    throw new Error(\n      'The `runtime` option has been removed. If you want to configure `runtime: \"automatic\"`, replace `@emotion/babel-preset-css-prop` with `@babel/preset-react` and `@emotion/babel-plugin`. You can find out how to configure things properly here: https://emotion.sh/docs/css-prop#babel-preset'\n    )\n  }\n\n  return {\n    plugins: [\n      [\n        pragmatic,\n        {\n          export: 'jsx',\n          module: '@emotion/react',\n          import: pragmaName\n        }\n      ],\n      [\n        jsx,\n        {\n          pragma: pragmaName,","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/emotion-js/emotion/blob/b882bcba85132554992e4bd49e94c95939bbf810/packages/babel-preset-css-prop/src/index.js#L1-L35","documentation":"@emotion/babel-preset-css-prop previously accepted a `runtime` option, which has been removed. The preset now throws immediately if `runtime` is present, directing users to use @babel/preset-react with @emotion/babel-plugin for the automatic runtime instead.","triggerScenarios":"Passing { runtime: 'automatic' } (or any truthy runtime value) to @emotion/babel-preset-css-prop in babel presets array, typically copied from React 17 automatic-JSX-runtime migration guides.","commonSituations":"Upgrading emotion after migrating to React 17/18's automatic JSX runtime while keeping the old preset options, or following outdated docs.","solutions":["Remove the `runtime` option from the preset config","Replace @emotion/babel-preset-css-prop with ['@babel/preset-react', { runtime: 'automatic' }] plus '@emotion/babel-plugin'","Follow https://emotion.sh/docs/css-prop#babel-preset for the current preset configuration"],"exampleFix":"// before\npresets: ['@emotion/babel-preset-css-prop'] // with { runtime: 'automatic' }\n// after\npresets: [['@babel/preset-react', { runtime: 'automatic' }]],\nplugins: ['@emotion/babel-plugin']","handlingStrategy":"validation","validationCode":"const presetOptions = { pragma, sourceMap, autoLabel, labelFormat, importMap };\nif ('runtime' in presetOptions) throw new Error('runtime option removed from @emotion/babel-preset-css-prop');","typeGuard":"const isValidPresetOpts = (o) => o == null || !('runtime' in o);","tryCatchPattern":null,"preventionTips":["Check the changelog when upgrading emotion presets","Migrate to @babel/preset-react + @emotion/babel-plugin for automatic runtime","Avoid spreading arbitrary objects into preset options"],"tags":["babel","emotion","breaking-change","configuration"],"backgroundTag":"removed-option","analyzedSha":"b882bcba85132554992e4bd49e94c95939bbf810","analyzedAt":"2026-09-02T22:27:13.739Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}