{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/6604","repository_url":"https://api.github.com/repos/babel/babel","labels_url":"https://api.github.com/repos/babel/babel/issues/6604/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/6604/comments","events_url":"https://api.github.com/repos/babel/babel/issues/6604/events","html_url":"https://github.com/babel/babel/issues/6604","id":269652227,"number":6604,"title":"transform-class-properties together with babel env","user":{"login":"babel-bot","id":21250019,"avatar_url":"https://avatars1.githubusercontent.com/u/21250019?v=4","gravatar_id":"","url":"https://api.github.com/users/babel-bot","html_url":"https://github.com/babel-bot","followers_url":"https://api.github.com/users/babel-bot/followers","following_url":"https://api.github.com/users/babel-bot/following{/other_user}","gists_url":"https://api.github.com/users/babel-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/babel-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/babel-bot/subscriptions","organizations_url":"https://api.github.com/users/babel-bot/orgs","repos_url":"https://api.github.com/users/babel-bot/repos","events_url":"https://api.github.com/users/babel-bot/events{/privacy}","received_events_url":"https://api.github.com/users/babel-bot/received_events","type":"User","site_admin":false},"labels":[{"id":735431822,"url":"https://api.github.com/repos/babel/babel/labels/imported","name":"imported","color":"ededed","default":false},{"id":711879390,"url":"https://api.github.com/repos/babel/babel/labels/pkg:%20preset-env","name":"pkg: preset-env","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2017-09-16T17:27:54Z","updated_at":"2018-04-22T19:43:55Z","closed_at":null,"author_association":"COLLABORATOR","body":"> Issue originally reported by @marcoacierno in babel/babel-preset-env#417\n\nI'm having difficulties using the plugin transform-class-properties together with babel-preset-env, even if it's defined in the `.babelrc` the build still says 'Missing class properties transform.'. Searching online I found that you need to use transform-class-properties before the others (or after, can't recall now) but as far as I know I can't change the execution order in the babelrc.\r\n\r\nHow can I solve this problem?\r\n\r\nThe error\r\n\r\n```\r\nSyntaxError: /Users/marco/projects/TAOPP/Frontend/js/App.js: Missing class properties transform.\r\n  32 |\r\n  33 | class App extends React.Component {\r\n> 34 |     static childContextTypes = {\r\n     |     ^\r\n```\r\n\r\nMy .babelrc\r\n\r\n```\r\n{\r\n    'presets': [\r\n        ['env', {\r\n            'targets': {\r\n                'browsers': ['last 2 versions'],\r\n            },\r\n            'modules': false,\r\n            'debug': true,\r\n        }],\r\n        'react',\r\n    ],\r\n    'plugins': [\r\n        'transform-class-properties',\r\n        'transform-object-rest-spread',\r\n    ],\r\n    'env': {\r\n        'server': {\r\n            'presets': [\r\n                ['env', {\r\n                    'modules': 'commonjs',\r\n                }],\r\n            ]\r\n        },\r\n        'production': {\r\n            'presets': ['minify'],\r\n        },\r\n    },\r\n}\r\n```\r\n\r\n(p.s. the documentation is not really clear about how `.babelrc` handles the env merge, so I'm not sure that my babelrc is correct)"},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/383407109","html_url":"https://github.com/babel/babel/issues/6604#issuecomment-383407109","issue_url":"https://api.github.com/repos/babel/babel/issues/6604","id":383407109,"user":{"login":"rizedr","id":3323353,"avatar_url":"https://avatars2.githubusercontent.com/u/3323353?v=4","gravatar_id":"","url":"https://api.github.com/users/rizedr","html_url":"https://github.com/rizedr","followers_url":"https://api.github.com/users/rizedr/followers","following_url":"https://api.github.com/users/rizedr/following{/other_user}","gists_url":"https://api.github.com/users/rizedr/gists{/gist_id}","starred_url":"https://api.github.com/users/rizedr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizedr/subscriptions","organizations_url":"https://api.github.com/users/rizedr/orgs","repos_url":"https://api.github.com/users/rizedr/repos","events_url":"https://api.github.com/users/rizedr/events{/privacy}","received_events_url":"https://api.github.com/users/rizedr/received_events","type":"User","site_admin":false},"created_at":"2018-04-22T19:43:54Z","updated_at":"2018-04-22T19:43:54Z","author_association":"NONE","body":"The easiest way around this is to use `babel-preset-react-app`. And your `.babelrc` file like this:\r\n```\r\n{\r\n  \"presets\": [\r\n    \"env\",\r\n    \"react-app\"\r\n  ]\r\n}\r\n```"}}
{"actor":{"display_login":"rizedr"}}