{"action":"opened","issue":{"url":"https://api.github.com/repos/mzgoddard/hard-source-webpack-plugin/issues/362","repository_url":"https://api.github.com/repos/mzgoddard/hard-source-webpack-plugin","labels_url":"https://api.github.com/repos/mzgoddard/hard-source-webpack-plugin/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/mzgoddard/hard-source-webpack-plugin/issues/362/comments","events_url":"https://api.github.com/repos/mzgoddard/hard-source-webpack-plugin/issues/362/events","html_url":"https://github.com/mzgoddard/hard-source-webpack-plugin/issues/362","id":327517627,"number":362,"title":"Problem with CacheModuleResolver","user":{"login":"omarstreak","id":1332109,"avatar_url":"https://avatars1.githubusercontent.com/u/1332109?v=4","gravatar_id":"","url":"https://api.github.com/users/omarstreak","html_url":"https://github.com/omarstreak","followers_url":"https://api.github.com/users/omarstreak/followers","following_url":"https://api.github.com/users/omarstreak/following{/other_user}","gists_url":"https://api.github.com/users/omarstreak/gists{/gist_id}","starred_url":"https://api.github.com/users/omarstreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omarstreak/subscriptions","organizations_url":"https://api.github.com/users/omarstreak/orgs","repos_url":"https://api.github.com/users/omarstreak/repos","events_url":"https://api.github.com/users/omarstreak/events{/privacy}","received_events_url":"https://api.github.com/users/omarstreak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-29T23:06:39Z","updated_at":"2018-05-29T23:06:39Z","closed_at":null,"author_association":"NONE","body":"We have a pretty sophisticated tool chain so digging into the depths of reproduction steps are too onerous for me right now. What I can say is that [Line 140 of CacheModuleResolver](https://github.com/mzgoddard/hard-source-webpack-plugin/blob/master/lib/CacheModuleResolver.js#L140) was throwing an error. I fixed this locally by changing that line to be: \r\n```\r\nconst normalMissing =\r\n                (\r\n                  missingCache[normalId] &&\r\n                  missingCache[normalId][\r\n                    JSON.stringify([\r\n                      resolveKey[1],\r\n                      resolveItem.resource.split('?')[0],\r\n                    ])\r\n                  ]\r\n                );\r\n```\r\n\r\nWhat was happening was that normalId was being set to a key that didn't exist in missingCache, and so missingCache[normalId][...] would result in trying to access a property on undefined.\r\n\r\nAnother thing I found was that pretty much every resolveItem.resolveOptions in the moduleResolveCache was set to an empty object i.e. ```{}``` however, for one of the entries the resolveItem.resolveOptions was set to an object with a couple of properties, this would result in a different normalId that wasn't on missingCache and thus the exception.\r\n\r\nI tried to trace how the resolveItem and resolveItem.resolveOptions were generated and where those properties were coming from, etc, but got stuck. My guess is that my patch is just papering over a more fundamental issue, so if you have some feedback/advice on figuring out what's going on at a deeper level that would be helpful, thanks!"}}
{"actor":{"display_login":"omarstreak"}}