{"action":"opened","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/746","labels_url":"https://api.github.com/repos/webpack/webpack/issues/746/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/746/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/746/events","html_url":"https://github.com/webpack/webpack/issues/746","id":56122087,"number":746,"title":"HMR issue with jsx-loader","user":{"login":"fredericlb","id":326828,"avatar_url":"https://avatars.githubusercontent.com/u/326828?v=3","gravatar_id":"","url":"https://api.github.com/users/fredericlb","html_url":"https://github.com/fredericlb","followers_url":"https://api.github.com/users/fredericlb/followers","following_url":"https://api.github.com/users/fredericlb/following{/other_user}","gists_url":"https://api.github.com/users/fredericlb/gists{/gist_id}","starred_url":"https://api.github.com/users/fredericlb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredericlb/subscriptions","organizations_url":"https://api.github.com/users/fredericlb/orgs","repos_url":"https://api.github.com/users/fredericlb/repos","events_url":"https://api.github.com/users/fredericlb/events{/privacy}","received_events_url":"https://api.github.com/users/fredericlb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-31T11:29:48Z","updated_at":"2015-01-31T11:29:48Z","closed_at":null,"body":"Hi,\r\n\r\nI'm having a strange issue when HMR is used with jsx-loader, but I can't find who is responsible for this.\r\n\r\nSay I have this class :\r\n\r\n```javascript\r\nvar Record = require(\"immutable\").Record;\r\nvar BaseRecord = Record({x: 0, y: 0, space: \"TEST\"});\r\n\r\nclass Point extends BaseRecord {\r\n\r\n    toScreen(screen, viewport) {\r\n            /** STUFF **/\r\n            return Point.screen(width * (xw / bw), height * (yh / bh), \"SCREEN\");\r\n    }\r\n\r\n    toGraph(screen, viewport) {\r\n            /** STUFF **/\r\n            return Point.graph(l + (bw * (x / width)),t + (bh * (y / height)), \"GRAPH\");\r\n    }\r\n\r\n    static graph(x,y){ return new Point({x: x, y: y, space: \"GRAPH\"}) }\r\n    static screen(x,y){ return new Point({x: x, y: y, space: \"SPACE\"}) }\r\n}\r\n\r\n\r\nmodule.exports = Point;\r\n```\r\n\r\njsx-loader, when going through react-tools, converts it in this form : \r\n```javascript\r\nvar Record = __webpack_require__(/*! immutable */ 162).Record;\r\n\r\nvar BaseRecord = Record({x: 0, y: 0, space: \"TEST\"});\r\n\r\nfor(var BaseRecord____Key in BaseRecord){if(BaseRecord.hasOwnProperty(BaseRecord____Key)){Point[BaseRecord____Key]=BaseRecord[BaseRecord____Key];}}var ____SuperProtoOfBaseRecord=BaseRecord===null?null:BaseRecord.prototype;Point.prototype=Object.create(____SuperProtoOfBaseRecord);Point.prototype.constructor=Point;Point.__superConstructor__=BaseRecord;function Point(){\"use strict\";if(BaseRecord!==null){BaseRecord.apply(this,arguments);}}\r\n\r\n    Point.prototype.toScreen=function(screen, viewport) {\"use strict\";\r\n/** STUFF */\r\n            return Point.screen(width * (xw / bw), height * (yh / bh), \"SCREEN\");\r\n    };\r\n\r\n    Point.prototype.toGraph=function(screen, viewport) {\"use strict\";\r\n/** STUFF */\r\n            return Point.graph(l + (bw * (x / width)),t + (bh * (y / height)), \"GRAPH\");\r\n    };\r\n\r\n    Point.graph=function(x,y){\"use strict\"; return new Point({x: x, y: y, space: \"GRAPH\"}) };\r\n    Point.screen=function(x,y){\"use strict\";  return new Point({x: x, y: y, space: \"SPACE\"}) };\r\n\r\n\r\n\r\nmodule.exports = Point;\r\n\r\n\r\n/*****************\r\n ** WEBPACK FOOTER\r\n ** ./app/Data/Point.js\r\n ** module id = 212\r\n ** module chunks = 0\r\n **/\r\n```\r\n\r\nand it works great until HMR reload this module. Then, when calling Point.graph or Point.screen,\r\nI have this error :\r\n```\r\nUncaught ReferenceError: BaseRecord is not defined\r\nPoint.js:5 Point\r\nPoint.js:39 Point.screen\r\n```\r\n\r\nI don't have any clue why this happens, and it's pretty difficult to find the culprit since I don't know anything about the internals of Webpack.\r\n\r\n"}}