{"action":"created","issue":{"url":"https://api.github.com/repos/halt-hammerzeit/webpack-isomorphic-tools/issues/38","labels_url":"https://api.github.com/repos/halt-hammerzeit/webpack-isomorphic-tools/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/halt-hammerzeit/webpack-isomorphic-tools/issues/38/comments","events_url":"https://api.github.com/repos/halt-hammerzeit/webpack-isomorphic-tools/issues/38/events","html_url":"https://github.com/halt-hammerzeit/webpack-isomorphic-tools/issues/38","id":121082999,"number":38,"title":"Relative paths on require() call don't match the values in webpack-assets.json","user":{"login":"sergesemashko","id":1267571,"avatar_url":"https://avatars.githubusercontent.com/u/1267571?v=3","gravatar_id":"","url":"https://api.github.com/users/sergesemashko","html_url":"https://github.com/sergesemashko","followers_url":"https://api.github.com/users/sergesemashko/followers","following_url":"https://api.github.com/users/sergesemashko/following{/other_user}","gists_url":"https://api.github.com/users/sergesemashko/gists{/gist_id}","starred_url":"https://api.github.com/users/sergesemashko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergesemashko/subscriptions","organizations_url":"https://api.github.com/users/sergesemashko/orgs","repos_url":"https://api.github.com/users/sergesemashko/repos","events_url":"https://api.github.com/users/sergesemashko/events{/privacy}","received_events_url":"https://api.github.com/users/sergesemashko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-08T19:41:20Z","updated_at":"2015-12-21T22:46:09Z","closed_at":"2015-12-09T15:23:37Z","body":"Hi, \r\n\r\nI have quite unusual way of configuring webpack. We have multiple projects with similar architecture, so we are trying to reuse webpack configuration. \r\n\r\nI created an [example](https://github.com/sergesemashko/webpack-shared-configuration-example) of project structure we are using, webpack configuration is encapsulated [here](https://github.com/sergesemashko/webpack-tools), so you could reproduce the issues I'm having.\r\n\r\n### 1st case\r\n\r\nPath of required style doesn't match path in webpack-assets.json. Style is required from shared component which is in node_modules.\r\n\r\n1. Open [http://localhost:3000/](http://localhost:3000/)\r\n2. Error is thrown:\r\n```bash\r\n[1] [webpack-isomorphic-tools] [error] asset not found: ./~/react-shared-library-example/dist/components/MyStyledComponent.scss\r\n[1] /Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react-shared-library-example/dist/components/MyStyledComponent.js:29\r\n[1]       { className: styles.wrapper },\r\n[1]                          ^\r\n[1] \r\n[1] TypeError: Cannot read property 'wrapper' of undefined\r\n[1]     at MyStyledComponent.render (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react-shared-library-example/dist/components/MyStyledComponent.js:29:26)\r\n[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:587:34)\r\n[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:607:32)\r\n[1]     at [object Object].wrapper [as _renderValidatedComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)\r\n[1]     at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:220:30)\r\n[1]     at [object Object].wrapper [as mountComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)\r\n[1]     at Object.ReactReconciler.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactReconciler.js:37:35)\r\n[1]     at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactMultiChild.js:241:44)\r\n[1]     at ReactDOMComponent.Mixin._createContentMarkup (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:591:32)\r\n[1]     at ReactDOMComponent.Mixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:479:29)\r\n```\r\n\r\n### 2nd case\r\n\r\n`Webpack-assets.json` contains absolute path `/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.scss`, but relative one `./modules/components/About.scss`  is required.\r\n\r\n1. Open [http://localhost:3000/about](http://localhost:3000/about ) \r\n2. Error is thrown:\r\n```bash\r\n[1] [webpack-isomorphic-tools] [error] asset not found: ./modules/components/About.scss\r\n[1] /Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.js:28\r\n[1]       { className: styles.wrapper },\r\n[1]                          ^\r\n[1] \r\n[1] TypeError: Cannot read property 'wrapper' of undefined\r\n[1]     at About.render (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.js:7:29)\r\n[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:587:34)\r\n[1]     at [object Object].ReactCompositeComponentMixin._renderValidatedComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:607:32)\r\n[1]     at [object Object].wrapper [as _renderValidatedComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)\r\n[1]     at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactCompositeComponent.js:220:30)\r\n[1]     at [object Object].wrapper [as mountComponent] (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactPerf.js:66:21)\r\n[1]     at Object.ReactReconciler.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactReconciler.js:37:35)\r\n[1]     at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactMultiChild.js:241:44)\r\n[1]     at ReactDOMComponent.Mixin._createContentMarkup (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:591:32)\r\n[1]     at ReactDOMComponent.Mixin.mountComponent (/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/node_modules/react/lib/ReactDOMComponent.js:479:29)\r\n```\r\n\r\n**webpack-assets.json:**\r\n```json\r\n{\r\n  \"javascript\": {\r\n    \"main\": \"http://localhost:3001/dist/main-8f70bcb9f4f52c2339c4.js\"\r\n  },\r\n  \"styles\": {},\r\n  \"assets\": {\r\n    \"../react-shared-library-example/dist/components/MyStyledComponent.scss\": {\r\n      \"wrapper\": \"wrapper___398WI\",\r\n      \"content\": \"content___2ECOw\",\r\n      \"_style\": \".wrapper___398WI {\\n  width: 100%;\\n  padding: 10px;\\n}\\n\\n.wrapper___398WI .content___2ECOw {\\n  width: 300px;\\n  height: 60px;\\n  margin: 0 auto;\\n  background-color: #666;\\n}\\n\"\r\n    },\r\n    \"/Users/siarheisemashka/Sites/webpack-isomorphic-tools-example/modules/components/About.scss\": {\r\n      \"wrapper\": \"wrapper___1Qxgf\",\r\n      \"_style\": \".wrapper___1Qxgf {\\n  background-color: #222222;\\n}\\n\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nAlso, you can find webpack isomorphic tools config [here](https://github.com/sergesemashko/webpack-tools/blob/master/webpack/webpack-isomorphic-tools.js).\r\n\r\nMost likely the roots of these issues are in encapsulated webpack config and I'm the only one who have them, but maybe changing paths in webpack-assets.json to absolute ones would help? Any thoughts on that?\r\n \r\nAny help or advices would be highly appreciated. "},"comment":{"url":"https://api.github.com/repos/halt-hammerzeit/webpack-isomorphic-tools/issues/comments/166444776","html_url":"https://github.com/halt-hammerzeit/webpack-isomorphic-tools/issues/38#issuecomment-166444776","issue_url":"https://api.github.com/repos/halt-hammerzeit/webpack-isomorphic-tools/issues/38","id":166444776,"user":{"login":"halt-hammerzeit","id":477167,"avatar_url":"https://avatars.githubusercontent.com/u/477167?v=3","gravatar_id":"","url":"https://api.github.com/users/halt-hammerzeit","html_url":"https://github.com/halt-hammerzeit","followers_url":"https://api.github.com/users/halt-hammerzeit/followers","following_url":"https://api.github.com/users/halt-hammerzeit/following{/other_user}","gists_url":"https://api.github.com/users/halt-hammerzeit/gists{/gist_id}","starred_url":"https://api.github.com/users/halt-hammerzeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halt-hammerzeit/subscriptions","organizations_url":"https://api.github.com/users/halt-hammerzeit/orgs","repos_url":"https://api.github.com/users/halt-hammerzeit/repos","events_url":"https://api.github.com/users/halt-hammerzeit/events{/privacy}","received_events_url":"https://api.github.com/users/halt-hammerzeit/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T22:46:08Z","updated_at":"2015-12-21T22:46:08Z","body":"About the wrong paths in `webpack-stats.json`\r\nFYI\r\nhttps://github.com/halt-hammerzeit/webpack-isomorphic-tools/issues/40"}}