{"action":"created","issue":{"url":"https://api.github.com/repos/NekR/async-module-loader/issues/2","repository_url":"https://api.github.com/repos/NekR/async-module-loader","labels_url":"https://api.github.com/repos/NekR/async-module-loader/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/NekR/async-module-loader/issues/2/comments","events_url":"https://api.github.com/repos/NekR/async-module-loader/issues/2/events","html_url":"https://github.com/NekR/async-module-loader/issues/2","id":118896439,"number":2,"title":"Always failing","user":{"login":"ferhtgoldaraz","id":2060086,"avatar_url":"https://avatars.githubusercontent.com/u/2060086?v=3","gravatar_id":"","url":"https://api.github.com/users/ferhtgoldaraz","html_url":"https://github.com/ferhtgoldaraz","followers_url":"https://api.github.com/users/ferhtgoldaraz/followers","following_url":"https://api.github.com/users/ferhtgoldaraz/following{/other_user}","gists_url":"https://api.github.com/users/ferhtgoldaraz/gists{/gist_id}","starred_url":"https://api.github.com/users/ferhtgoldaraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferhtgoldaraz/subscriptions","organizations_url":"https://api.github.com/users/ferhtgoldaraz/orgs","repos_url":"https://api.github.com/users/ferhtgoldaraz/repos","events_url":"https://api.github.com/users/ferhtgoldaraz/events{/privacy}","received_events_url":"https://api.github.com/users/ferhtgoldaraz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-25T18:28:15Z","updated_at":"2016-03-26T13:34:31Z","closed_at":null,"body":"I'm using your fork in a project. It's just what I needed, thanks for this.\r\n\r\nBut I'm having an issue, I'm always hitting the fail callback. Do the number of modules that return matter or something?\r\n\r\nWhen I do this:\r\n\r\n```js\r\nrequire.ensure(['layouts/admin/admin-layout'], function(require) {\r\n    var component = require('layouts/admin/admin-layout');\r\n    console.log(component);\r\n}, 'admin');\r\n```\r\n\r\nI get what I expect, the exports object. But when I do this:\r\n\r\n```js\r\nrequire('async-module?name=admin!layouts/admin/admin-layout')(\r\n\r\n    function success(component) {\r\n        console.log('success');\r\n    },\r\n\r\n    function fail() {\r\n        console.log('fail');\r\n    }\r\n\r\n);\r\n```\r\n\r\nI always get the fail.\r\n\r\nThis is my webpack.config:\r\n\r\n```js\r\nvar webpack = require('webpack');\r\nvar StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;\r\nvar AsyncModulePlugin = require('async-module-loader/plugin');\r\n\r\nvar plugins = [\r\n    new AsyncModulePlugin(),\r\n    new StatsWriterPlugin({\r\n        fields: null\r\n    })\r\n];\r\n\r\n// if (process.env.NODE_ENV === 'production' && !Meteor.isCordova) {\r\n//   plugins.push(new webpack.optimize.CommonsChunkPlugin('common', 'common.web.js'));\r\n// }\r\n\r\nmodule.exports = {\r\n    entry: './entry',\r\n    plugins: plugins,\r\n    output: {\r\n        chunkFilename: '[name]-[id].non-entry-chunk.web.js'\r\n    },\r\n    module: {\r\n        loaders: [\r\n            { test: /\\.jade/, loader: 'template-html-loader' }\r\n        ]\r\n    }\r\n};\r\n```\r\n\r\nAlso, the network tab in chrome shows that the chunk was requested, and the response is 200 OK, with this contents (no whitespace above or below), in both scenarios. **I repeat, same response in both scenarios**. That's what's killing me:\r\n\r\n```js\r\nwebpackJsonp([1],{\r\n\r\n/***/ 96:\r\n/***/ function(module, exports, __webpack_require__) {\r\n\r\n\t/**\r\n\t * Admin Layout\r\n\t *\r\n\t * Default markup shared by all admin entry points\r\n\t */\r\n\t\r\n\t//===== STYLE ================================================================\r\n\t\r\n\t\r\n\t\r\n\t//===== JS ===================================================================\r\n\t\r\n\t\r\n\t\r\n\t//===== DEFINE COMPONENT =====================================================\r\n\t\r\n\tmodule.exports = MD.Vue.extend({\r\n\t    template: __webpack_require__(97)\r\n\t});\r\n\r\n\r\n/***/ },\r\n\r\n/***/ 97:\r\n/***/ function(module, exports) {\r\n\r\n\tmodule.exports = \"<div class=\\\"admin-layout\\\"><p>This works as the layout for the admin stuff</p><router-view><p>this is content that can be accessed in the routed\\ncomponent through the slot tag</p></router-view></div>\"\r\n\r\n/***/ }\r\n\r\n});\r\n//# sourceMappingURL=admin-1.non-entry-chunk.web.js.map\r\n```\r\n\r\nI don't really know if this is expecte behaviour and I just don't get what bundle-loader should be doing, or there's some legitimate issue going on.\r\n\r\nHope it's something small. Again, thanks for your fork, really nice."},"comment":{"url":"https://api.github.com/repos/NekR/async-module-loader/issues/comments/201824544","html_url":"https://github.com/NekR/async-module-loader/issues/2#issuecomment-201824544","issue_url":"https://api.github.com/repos/NekR/async-module-loader/issues/2","id":201824544,"user":{"login":"erwingaitano","id":1928211,"avatar_url":"https://avatars.githubusercontent.com/u/1928211?v=3","gravatar_id":"","url":"https://api.github.com/users/erwingaitano","html_url":"https://github.com/erwingaitano","followers_url":"https://api.github.com/users/erwingaitano/followers","following_url":"https://api.github.com/users/erwingaitano/following{/other_user}","gists_url":"https://api.github.com/users/erwingaitano/gists{/gist_id}","starred_url":"https://api.github.com/users/erwingaitano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwingaitano/subscriptions","organizations_url":"https://api.github.com/users/erwingaitano/orgs","repos_url":"https://api.github.com/users/erwingaitano/repos","events_url":"https://api.github.com/users/erwingaitano/events{/privacy}","received_events_url":"https://api.github.com/users/erwingaitano/received_events","type":"User","site_admin":false},"created_at":"2016-03-26T13:34:31Z","updated_at":"2016-03-26T13:34:31Z","body":"Im having this issue too :cry: "}}