{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/1419","labels_url":"https://api.github.com/repos/webpack/webpack/issues/1419/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/1419/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/1419/events","html_url":"https://github.com/webpack/webpack/issues/1419","id":104972775,"number":1419,"title":"Duplicated instances of modules with loaders other than the default one (or babel's)","user":{"login":"guigrpa","id":2129481,"avatar_url":"https://avatars.githubusercontent.com/u/2129481?v=3","gravatar_id":"","url":"https://api.github.com/users/guigrpa","html_url":"https://github.com/guigrpa","followers_url":"https://api.github.com/users/guigrpa/followers","following_url":"https://api.github.com/users/guigrpa/following{/other_user}","gists_url":"https://api.github.com/users/guigrpa/gists{/gist_id}","starred_url":"https://api.github.com/users/guigrpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guigrpa/subscriptions","organizations_url":"https://api.github.com/users/guigrpa/orgs","repos_url":"https://api.github.com/users/guigrpa/repos","events_url":"https://api.github.com/users/guigrpa/events{/privacy}","received_events_url":"https://api.github.com/users/guigrpa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpack/webpack/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-04T21:26:05Z","updated_at":"2015-11-18T19:23:53Z","closed_at":null,"body":"I've seen this with **coffee-loader** and **cjsx-loader**, but #1249  also reports this problem with **jsx-loader**. The problem seems to appear when we require the same file from outside a module and from within the module:\r\n\r\n`a.coffee` (within module `bb`):\r\n```coffee\r\nmodule.exports = {just: 'an object'}\r\n```\r\n\r\n`b.coffee` (within module `bb`):\r\n```coffee\r\nmodule.exports = require './a'\r\n```\r\n\r\n`odd.coffee`:\r\n```coffee\r\na = require('bb/a');\r\nb = require('bb/b');\r\nconsole.log a is b  # should be true\r\n```\r\n\r\nWhen you run `coffee odd.coffee`, sure enough, you get: `true`.\r\nBut when you run it through Webpack (with coffee-loader):\r\n\r\n* You get module `a` bundled twice:\r\n\r\n```\r\n    [0] ./odd.coffee 94 bytes {0}\r\n    [1] /Users/guillermo/Docs/Docs.Prog/JavaScript/bb/a.coffee 56 bytes {0} [built]\r\n    [2] /Users/guillermo/Docs/Docs.Prog/JavaScript/bb/b.coffee 59 bytes {0}\r\n    [3] /Users/guillermo/Docs/Docs.Prog/JavaScript/bb/a.coffee 56 bytes {0} [built]\r\n```\r\n\r\n* What's worse, you get an unexpected result in the browser: `false`"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/157830289","html_url":"https://github.com/webpack/webpack/issues/1419#issuecomment-157830289","issue_url":"https://api.github.com/repos/webpack/webpack/issues/1419","id":157830289,"user":{"login":"guigrpa","id":2129481,"avatar_url":"https://avatars.githubusercontent.com/u/2129481?v=3","gravatar_id":"","url":"https://api.github.com/users/guigrpa","html_url":"https://github.com/guigrpa","followers_url":"https://api.github.com/users/guigrpa/followers","following_url":"https://api.github.com/users/guigrpa/following{/other_user}","gists_url":"https://api.github.com/users/guigrpa/gists{/gist_id}","starred_url":"https://api.github.com/users/guigrpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guigrpa/subscriptions","organizations_url":"https://api.github.com/users/guigrpa/orgs","repos_url":"https://api.github.com/users/guigrpa/repos","events_url":"https://api.github.com/users/guigrpa/events{/privacy}","received_events_url":"https://api.github.com/users/guigrpa/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T19:23:53Z","updated_at":"2015-11-18T19:23:53Z","body":"I really don't know, since I'm no longer having the same structure in my program."}}