{"action":"opened","issue":{"url":"https://api.github.com/repos/gaearon/react-transform-hmr/issues/13","labels_url":"https://api.github.com/repos/gaearon/react-transform-hmr/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/react-transform-hmr/issues/13/comments","events_url":"https://api.github.com/repos/gaearon/react-transform-hmr/issues/13/events","html_url":"https://github.com/gaearon/react-transform-hmr/issues/13","id":107791777,"number":13,"title":"Server-side rendering","user":{"login":"nikgraf","id":223045,"avatar_url":"https://avatars.githubusercontent.com/u/223045?v=3","gravatar_id":"","url":"https://api.github.com/users/nikgraf","html_url":"https://github.com/nikgraf","followers_url":"https://api.github.com/users/nikgraf/followers","following_url":"https://api.github.com/users/nikgraf/following{/other_user}","gists_url":"https://api.github.com/users/nikgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/nikgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikgraf/subscriptions","organizations_url":"https://api.github.com/users/nikgraf/orgs","repos_url":"https://api.github.com/users/nikgraf/repos","events_url":"https://api.github.com/users/nikgraf/events{/privacy}","received_events_url":"https://api.github.com/users/nikgraf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-22T20:10:06Z","updated_at":"2015-09-22T20:10:06Z","closed_at":null,"body":"When you compile your server with `babel-node` and render React Components on the server you will get the following error message: \r\n\r\n```\r\n/Users/nikgraf/Projects/time/node_modules/react-transform-hmr/lib/index.js:54\r\n    throw new Error('locals[0] does not appear to be a `module` object with Hot Module ' + 'replacement API enabled. You should disable react-transform-hmr in ' + 'production by using `env` section in Babel configuration. See the ' + 'example in README: https://github.com/gaearon/react-transform-hmr');\r\n    ^\r\n\r\nError: locals[0] does not appear to be a `module` object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using `env` section in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr\r\n    at proxyReactComponents (/Users/nikgraf/Projects/time/node_modules/react-transform-hmr/lib/index.js:54:11)\r\n    at Object.<anonymous> (/Users/nikgraf/Projects/time/src/containers/Index.js:5:67)\r\n    at Module._compile (module.js:434:26)\r\n    at normalLoader (/Users/nikgraf/Projects/time/node_modules/babel-core/lib/api/register/node.js:199:5)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/Users/nikgraf/Projects/time/node_modules/babel-core/lib/api/register/node.js:216:7)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n    at Object.<anonymous> (/Users/nikgraf/Projects/time/src/routes.js:8:35)\r\n22 Sep 21:55:38 - [nodemon] app crashed - waiting for file changes before starting...\r\n```\r\n\r\nIt's happening due this change: https://github.com/gaearon/react-transform-hmr/commit/9afec1bf687b170ca794fe2cca1622042e85aef7\r\n\r\nIdeally you want to avoid transforming on the server. Babel uses the existing `.babelrc` by default. There are several solutions I can imagine:\r\n\r\n1. Split the server into the webpack and the render part and proxy the rendering endpoint. In case `babel-node` would allow `babelrc` option you could provide an alternative `.babelrc`.\r\n2. Don't return an error and make it noop again :smile: \r\n\r\nDid I miss something? I'm happy to contribute, but I wasn't sure whats your opinion?\r\n\r\nP.S: I went for the proxy solution as I want to run the rendering server with nodemon anyway but avoid webpack from restarting continuously. I worked around it by setting `BABEL_ENV=\"developer-client\"`only  for the webpack process and also use \"developer-client\" in .babelrc."}}