{"action":"created","issue":{"url":"https://api.github.com/repos/speedskater/babel-plugin-rewire/issues/5","labels_url":"https://api.github.com/repos/speedskater/babel-plugin-rewire/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/speedskater/babel-plugin-rewire/issues/5/comments","events_url":"https://api.github.com/repos/speedskater/babel-plugin-rewire/issues/5/events","html_url":"https://github.com/speedskater/babel-plugin-rewire/issues/5","id":76163446,"number":5,"title":"TypeError: Filename must be a string","user":{"login":"DelvarWorld","id":79215,"avatar_url":"https://avatars.githubusercontent.com/u/79215?v=3","gravatar_id":"","url":"https://api.github.com/users/DelvarWorld","html_url":"https://github.com/DelvarWorld","followers_url":"https://api.github.com/users/DelvarWorld/followers","following_url":"https://api.github.com/users/DelvarWorld/following{/other_user}","gists_url":"https://api.github.com/users/DelvarWorld/gists{/gist_id}","starred_url":"https://api.github.com/users/DelvarWorld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DelvarWorld/subscriptions","organizations_url":"https://api.github.com/users/DelvarWorld/orgs","repos_url":"https://api.github.com/users/DelvarWorld/repos","events_url":"https://api.github.com/users/DelvarWorld/events{/privacy}","received_events_url":"https://api.github.com/users/DelvarWorld/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-13T23:40:34Z","updated_at":"2015-05-14T18:00:26Z","closed_at":null,"body":"I'm not sure what's causing this yet. I will close this bug if it turns out to be our fault. I included the babel rewire plugin in our webpack config:\r\n\r\n    babel-loader?plugins=rewire&optional=runtime\r\n\r\nWhen I run webpack (building our test bundle), I get:\r\n\r\n    ERROR in vendors.js\r\n    Module build failed: TypeError: Filename must be a string\r\n\r\nThe content of vendors.js aren't anything exciting:\r\n\r\n    require('react');\r\n    require('lodash');\r\n    require('react-router');\r\n\r\nThe stack trace exits at \r\n\r\n    at Object.module.exports (/node_modules/babel-loader/index.js:43:24)\r\n\r\nso I'm not sure what's originating the error. If I log inside that line to see what filename is it prints out a very large object that isn't immediately recognizable.\r\n\r\nDoes this plugin still work with regular require statements alongside es6 import statements? Actually, even if I make the contents of that file only `import \"react\";` it gives me the same error...\r\n\r\nMight be worth noting I'm using [rewire-webpack](https://github.com/jhnns/rewire-webpack), although this error still persists if I remove rewire-webpack it from my webpack plugins list."},"comment":{"url":"https://api.github.com/repos/speedskater/babel-plugin-rewire/issues/comments/102119351","html_url":"https://github.com/speedskater/babel-plugin-rewire/issues/5#issuecomment-102119351","issue_url":"https://api.github.com/repos/speedskater/babel-plugin-rewire/issues/5","id":102119351,"user":{"login":"DelvarWorld","id":79215,"avatar_url":"https://avatars.githubusercontent.com/u/79215?v=3","gravatar_id":"","url":"https://api.github.com/users/DelvarWorld","html_url":"https://github.com/DelvarWorld","followers_url":"https://api.github.com/users/DelvarWorld/followers","following_url":"https://api.github.com/users/DelvarWorld/following{/other_user}","gists_url":"https://api.github.com/users/DelvarWorld/gists{/gist_id}","starred_url":"https://api.github.com/users/DelvarWorld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DelvarWorld/subscriptions","organizations_url":"https://api.github.com/users/DelvarWorld/orgs","repos_url":"https://api.github.com/users/DelvarWorld/repos","events_url":"https://api.github.com/users/DelvarWorld/events{/privacy}","received_events_url":"https://api.github.com/users/DelvarWorld/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T18:00:26Z","updated_at":"2015-05-14T18:00:26Z","body":"Tested in a blank project, simply adding this line:\r\n\r\n    var rewire = require('rewire');\r\n\r\nTriggers the errors/warnings:\r\n\r\n    WARNING in ./~/rewire/lib/moduleEnv.js\r\n    require.extensions is not supported by webpack. Use a loader instead.\r\n\r\n    WARNING in ./~/rewire/lib/moduleEnv.js\r\n    Module not found: Error: Cannot resolve module 'coffee-script' in node_modules/rewire/lib\r\n    @ ./~/rewire/lib/moduleEnv.js 103:13-37\r\n\r\n    ERROR in ./~/rewire/lib/rewire.js\r\n    Module not found: Error: Cannot resolve module 'module' in node_modules/rewire/lib\r\n    @ ./~/rewire/lib/rewire.js 22:13-30\r\n\r\nHowever, if I add this to the webpack config in the blank project:\r\n\r\n    var RewirePlugin          = require(\"rewire-webpack\");\r\n    ....\r\n    plugins: [\r\n          new RewirePlugin()\r\n    ]\r\n\r\nThen the bundle is valid. More investigation required..."}}