chrisbateman / webpack-visualizer

Visualize your Webpack bundle
http://chrisbateman.github.io/webpack-visualizer/
MIT License
1.69k stars 93 forks source link

TypeError: Cannot read property 'modules' of undefined #28

Closed haggholm closed 7 years ago

haggholm commented 7 years ago

I have a set of stats that gives me errors—curiously, different errors in different browsers, for the exact same stats (though it’s consistent between my local HTML and the online site). In Chrome:

Uncaught TypeError: Cannot read property 'modules' of undefined
    at e.onAssetChange (http://chrisbateman.github.io/webpack-visualizer/build.js:18:5684)
    at Object.executeOnChange (http://chrisbateman.github.io/webpack-visualizer/build.js:16:22674)
    at g.i (http://chrisbateman.github.io/webpack-visualizer/build.js:16:29988)
    at Object.r (http://chrisbateman.github.io/webpack-visualizer/build.js:1:28940)
    at a (http://chrisbateman.github.io/webpack-visualizer/build.js:1:27763)
    at Object.u [as executeDispatchesInOrder] (http://chrisbateman.github.io/webpack-visualizer/build.js:1:27974)
    at f (http://chrisbateman.github.io/webpack-visualizer/build.js:1:24401)
    at h (http://chrisbateman.github.io/webpack-visualizer/build.js:1:24527)
    at Array.forEach (native)
    at n (http://chrisbateman.github.io/webpack-visualizer/build.js:1:29425)

In Firefox:

TypeError: i.chunk is undefined[Learn More]  build.js:18:5675
    e.default<.onAssetChange http://chrisbateman.github.io/webpack-visualizer/build.js:18:5675
    bound  self-hosted
    h.executeOnChange http://chrisbateman.github.io/webpack-visualizer/build.js:16:22663
    i http://chrisbateman.github.io/webpack-visualizer/build.js:16:29986
    bound i self-hosted
    r http://chrisbateman.github.io/webpack-visualizer/build.js:1:28940
    a http://chrisbateman.github.io/webpack-visualizer/build.js:1:27761
    u http://chrisbateman.github.io/webpack-visualizer/build.js:1:27974
    f http://chrisbateman.github.io/webpack-visualizer/build.js:1:24399
    h http://chrisbateman.github.io/webpack-visualizer/build.js:1:24527
    forEach self-hosted
    n http://chrisbateman.github.io/webpack-visualizer/build.js:1:29423
    v.processEventQueue http://chrisbateman.github.io/webpack-visualizer/build.js:1:25647
    r http://chrisbateman.github.io/webpack-visualizer/build.js:1:29529
    i.handleTopLevel http://chrisbateman.github.io/webpack-visualizer/build.js:1:29636
    a http://chrisbateman.github.io/webpack-visualizer/build.js:17:4352
    i http://chrisbateman.github.io/webpack-visualizer/build.js:17:4168
    o.perform http://chrisbateman.github.io/webpack-visualizer/build.js:15:12491
    p.batchedUpdates http://chrisbateman.github.io/webpack-visualizer/build.js:16:7078
    i http://chrisbateman.github.io/webpack-visualizer/build.js:15:8436
    m.dispatchEvent http://chrisbateman.github.io/webpack-visualizer/build.js:17:5240
    bound  self-hosted
chrisbateman commented 7 years ago

Is there any way that you could share your stats.json file?

haggholm commented 7 years ago

Stripped of the source code, both because it’s bloody enormous and because I don’t know what our policy is… I verified that I get the same error with this as the original-with-source version.

stats.json.gz

chrisbateman commented 7 years ago

Turns out I had a bad assumption about the way the chunks are listed. Thanks for example!

haggholm commented 7 years ago

And thank you for fixing it!