{"action":"created","issue":{"url":"https://api.github.com/repos/christianalfoni/react-webpack-cookbook/issues/21","labels_url":"https://api.github.com/repos/christianalfoni/react-webpack-cookbook/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/christianalfoni/react-webpack-cookbook/issues/21/comments","events_url":"https://api.github.com/repos/christianalfoni/react-webpack-cookbook/issues/21/events","html_url":"https://github.com/christianalfoni/react-webpack-cookbook/issues/21","id":70871212,"number":21,"title":"Line 1: Unexpected reserved word","user":{"login":"vincenzo-antolini-os","id":533124,"avatar_url":"https://avatars.githubusercontent.com/u/533124?v=3","gravatar_id":"","url":"https://api.github.com/users/vincenzo-antolini-os","html_url":"https://github.com/vincenzo-antolini-os","followers_url":"https://api.github.com/users/vincenzo-antolini-os/followers","following_url":"https://api.github.com/users/vincenzo-antolini-os/following{/other_user}","gists_url":"https://api.github.com/users/vincenzo-antolini-os/gists{/gist_id}","starred_url":"https://api.github.com/users/vincenzo-antolini-os/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincenzo-antolini-os/subscriptions","organizations_url":"https://api.github.com/users/vincenzo-antolini-os/orgs","repos_url":"https://api.github.com/users/vincenzo-antolini-os/repos","events_url":"https://api.github.com/users/vincenzo-antolini-os/events{/privacy}","received_events_url":"https://api.github.com/users/vincenzo-antolini-os/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-04-25T07:50:08Z","updated_at":"2015-06-04T04:44:01Z","closed_at":"2015-04-25T08:15:28Z","body":"Hi,\r\nthe following javascript code\r\n\r\n```javascript\r\nimport React from 'react';\r\n\r\nexport default React.createClass({\r\n  render: function () {\r\n    return React.createElement('h1', null, 'Hello world');\r\n  }\r\n});\r\n;\r\n```\r\n\r\nfound in https://github.com/christianalfoni/react-webpack-cookbook/wiki/Configuring-react-js\r\n\r\ngives me the following error when launching webpack\r\n\r\n````\r\nERROR in ./app/Component.js\r\nModule parse failed: C:\\inetpub\\wwwroot\\webpack\\app\\Component.js Line 1: Unexpected reserved word\r\nYou may need an appropriate loader to handle this file type.\r\n| import React from 'react';\r\n|\r\n| export default React.createClass({\r\n @ ./app/main.js 3:16-41\r\n````\r\n\r\nCan you help me?\r\nI'm a noob ;)\r\n"},"comment":{"url":"https://api.github.com/repos/christianalfoni/react-webpack-cookbook/issues/comments/108720014","html_url":"https://github.com/christianalfoni/react-webpack-cookbook/issues/21#issuecomment-108720014","issue_url":"https://api.github.com/repos/christianalfoni/react-webpack-cookbook/issues/21","id":108720014,"user":{"login":"bebraw","id":166921,"avatar_url":"https://avatars.githubusercontent.com/u/166921?v=3","gravatar_id":"","url":"https://api.github.com/users/bebraw","html_url":"https://github.com/bebraw","followers_url":"https://api.github.com/users/bebraw/followers","following_url":"https://api.github.com/users/bebraw/following{/other_user}","gists_url":"https://api.github.com/users/bebraw/gists{/gist_id}","starred_url":"https://api.github.com/users/bebraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bebraw/subscriptions","organizations_url":"https://api.github.com/users/bebraw/orgs","repos_url":"https://api.github.com/users/bebraw/repos","events_url":"https://api.github.com/users/bebraw/events{/privacy}","received_events_url":"https://api.github.com/users/bebraw/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T04:44:01Z","updated_at":"2015-06-04T04:44:01Z","body":"@dvc94ch Your configuration is missing a little something. Try this:\r\n\r\n```javascript\r\n  module: {\r\n    loaders: [{\r\n      test: /\\.es6\\.js$/,\r\n      exclude: /(node_modules|bower_components)/,\r\n      loader: 'babel',\r\n      query: {\r\n        cacheDirectory: true,\r\n        optional: ['runtime'],\r\n        stage: 0\r\n      }\r\n    }]\r\n  }\r\n```\r\n\r\nNow it should be able to pick up the loader correctly. Note that you may need to hit `npm i babel-runtime babel-loader` for that to work correctly. Hit `npm i babel-runtime babel-loader --save-dev` to include them as dev deps."}}