{"action":"created","issue":{"url":"https://api.github.com/repos/mksarge/redux-json-router/issues/6","repository_url":"https://api.github.com/repos/mksarge/redux-json-router","labels_url":"https://api.github.com/repos/mksarge/redux-json-router/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mksarge/redux-json-router/issues/6/comments","events_url":"https://api.github.com/repos/mksarge/redux-json-router/issues/6/events","html_url":"https://github.com/mksarge/redux-json-router/issues/6","id":300461715,"node_id":"MDU6SXNzdWUzMDA0NjE3MTU=","number":6,"title":"Webpack 4 issue","user":{"login":"msimonc","id":2308694,"node_id":"MDQ6VXNlcjIzMDg2OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/2308694?v=4","gravatar_id":"","url":"https://api.github.com/users/msimonc","html_url":"https://github.com/msimonc","followers_url":"https://api.github.com/users/msimonc/followers","following_url":"https://api.github.com/users/msimonc/following{/other_user}","gists_url":"https://api.github.com/users/msimonc/gists{/gist_id}","starred_url":"https://api.github.com/users/msimonc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msimonc/subscriptions","organizations_url":"https://api.github.com/users/msimonc/orgs","repos_url":"https://api.github.com/users/msimonc/repos","events_url":"https://api.github.com/users/msimonc/events{/privacy}","received_events_url":"https://api.github.com/users/msimonc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-27T01:37:30Z","updated_at":"2018-07-05T19:57:49Z","closed_at":null,"author_association":"NONE","body":"Hi Michael,\r\n\r\nThanks for this,\r\n\r\nIf I upgrade my project to Webpack 4, on npm start I get:\r\n\r\nERROR in ./config/routes.json\r\nModule parse failed: Unexpected token e in JSON at position 0\r\nYou may need an appropriate loader to handle this file type.\r\nSyntaxError: Unexpected token e in JSON at position 0\r\n    at JSON.parse (<anonymous>)\r\n    at JsonParser.parse (/Projects/NeighbourCare/react-starter-app/node_modules/webpack/lib/JsonParser.js:15:21)"},"comment":{"url":"https://api.github.com/repos/mksarge/redux-json-router/issues/comments/402835407","html_url":"https://github.com/mksarge/redux-json-router/issues/6#issuecomment-402835407","issue_url":"https://api.github.com/repos/mksarge/redux-json-router/issues/6","id":402835407,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjgzNTQwNw==","user":{"login":"kevindice","id":5779569,"node_id":"MDQ6VXNlcjU3Nzk1Njk=","avatar_url":"https://avatars1.githubusercontent.com/u/5779569?v=4","gravatar_id":"","url":"https://api.github.com/users/kevindice","html_url":"https://github.com/kevindice","followers_url":"https://api.github.com/users/kevindice/followers","following_url":"https://api.github.com/users/kevindice/following{/other_user}","gists_url":"https://api.github.com/users/kevindice/gists{/gist_id}","starred_url":"https://api.github.com/users/kevindice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevindice/subscriptions","organizations_url":"https://api.github.com/users/kevindice/orgs","repos_url":"https://api.github.com/users/kevindice/repos","events_url":"https://api.github.com/users/kevindice/events{/privacy}","received_events_url":"https://api.github.com/users/kevindice/received_events","type":"User","site_admin":false},"created_at":"2018-07-05T19:57:49Z","updated_at":"2018-07-05T19:57:49Z","author_association":"NONE","body":"This fix the problem for me.\r\n\r\nTo clarify for the next person who arrives here from a Google search, `type: \"javascript/auto` is added to the `redux-json-router/lib/route-loader` loader config in `webpack.config.js` like this:\r\n\r\n```javascript\r\nconst routes = [path.resolve(__dirname, './path/to/routes.json')];\r\n\r\n...\r\n{\r\n  test: /\\.json$/,\r\n  exclude: routes,\r\n  loader: 'json-loader',\r\n},\r\n{\r\n  test: /\\.json$/,\r\n  type: \"javascript/auto\",\r\n  include: routes,\r\n  loader: 'redux-json-router/lib/route-loader',\r\n  options: {\r\n    ...\r\n  }\r\n},\r\n...\r\n```"}}
{"actor":{"display_login":"kevindice"}}