Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue when bundle don't have metrics at all #221

Merged
merged 2 commits into from
Nov 8, 2017
Merged

fix issue when bundle don't have metrics at all #221

merged 2 commits into from
Nov 8, 2017

Conversation

DrSensor
Copy link
Contributor

@DrSensor DrSensor commented Nov 7, 2017

this issue can be found in electron based project when using electron API in renderer

yarn run v1.2.1
$ webpack-dashboard -- node .electron-vue/dev-runner.js
TypeError: Cannot read property 'meta' of undefined
    at assets.filter.map.asset (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/webpack-dashboard/utils/format-assets.js:28:41)
    at Array.map (<anonymous>)
    at _.flatMap.assets (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/webpack-dashboard/utils/format-assets.js:24:8)
    at l (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/lodash/lodash.min.js:6:443)
    at uu (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/lodash/lodash.min.js:67:252)
    at On.flatMap (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/lodash/lodash.min.js:99:101)
    at l (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/lodash/lodash.min.js:50:137)
    at resolveAssets (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/webpack-dashboard/utils/format-assets.js:32:4)
    at printAssets (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/webpack-dashboard/utils/format-assets.js:36:18)
    at formatAssets (/home/wildan/Projects/Sensorfied/f.i.d.e/node_modules/webpack-dashboard/utils/format-assets.js:55:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

encounter this bug when using vue-electron template project

- this issue can be found in electron based project when using electron API in renderer
@@ -72,7 +72,7 @@ function groupModules(bundle) {
});
}),
_.orderBy(_.get("size.minGz"), "desc")
)(bundle.metrics.sizes);
)(realBundleMatch.metrics ? bundle.metrics.sizes : []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

realBundleMatch is undefined and failing lint. Has this code been tested yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it seems I get typo 😢 . Going to fix it in few minutes using my phone.

@ryan-roemer ryan-roemer merged commit 338cc53 into FormidableLabs:master Nov 8, 2017
@ryan-roemer
Copy link
Member

Thanks @DrSensor ! Released in webpack-dashboard@1.0.2

@ryan-roemer ryan-roemer mentioned this pull request Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants