{"action":"closed","issue":{"url":"https://api.github.com/repos/jhnns/rewire/issues/77","labels_url":"https://api.github.com/repos/jhnns/rewire/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/jhnns/rewire/issues/77/comments","events_url":"https://api.github.com/repos/jhnns/rewire/issues/77/events","html_url":"https://github.com/jhnns/rewire/issues/77","id":111085418,"number":77,"title":"Enable rewiring rewired modules","user":{"login":"TheSavior","id":249164,"avatar_url":"https://avatars.githubusercontent.com/u/249164?v=3","gravatar_id":"","url":"https://api.github.com/users/TheSavior","html_url":"https://github.com/TheSavior","followers_url":"https://api.github.com/users/TheSavior/followers","following_url":"https://api.github.com/users/TheSavior/following{/other_user}","gists_url":"https://api.github.com/users/TheSavior/gists{/gist_id}","starred_url":"https://api.github.com/users/TheSavior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheSavior/subscriptions","organizations_url":"https://api.github.com/users/TheSavior/orgs","repos_url":"https://api.github.com/users/TheSavior/repos","events_url":"https://api.github.com/users/TheSavior/events{/privacy}","received_events_url":"https://api.github.com/users/TheSavior/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-13T01:27:31Z","updated_at":"2015-10-13T01:36:55Z","closed_at":"2015-10-13T01:36:55Z","body":"babel-plugin-rewire, rewireify, and rewire-global all hook require, injecting the functions into every module. \r\n\r\nWhen we use [getDefinePropertySrc](https://github.com/jhnns/rewire/blob/master/lib/getDefinePropertySrc.js) we run into problems on modules that pass through their dependencies unchanged. See this failing test on rewire-global: https://github.com/TheSavior/rewire-global/pull/13/files\r\n\r\nThe error we get is:\r\n```\r\nTypeError: Cannot redefine property: __get__\r\n      at Function.defineProperty (native)\r\n      at test/fixtures/keys-pass-through.js:7:8\r\n      at Object.<anonymous> (test/fixtures/keys-pass-through.js:101:9)\r\n      at Context.<anonymous> (test/tests/tests.js:63:5)\r\n```\r\n\r\nBefore starting to use the upstream modules from rewire in rewireify and rewire-global, we got around this by setting the properties to writable: https://github.com/i-like-robots/rewireify/blob/master/lib/index.js#L37\r\n\r\nRewire [does not set them to writable](https://github.com/jhnns/rewire/blob/master/lib/getDefinePropertySrc.js#L17). I was looking through how the tests in rewire worked to try to add a failing test here and wasn't sure how to repro this since it is a bit of a different use case, but one we want to support.\r\n\r\n"}}