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

TypeError: Cannot read property 'split' of undefined #626

Closed
nilanjansiromani opened this issue Feb 21, 2020 · 2 comments
Closed

TypeError: Cannot read property 'split' of undefined #626

nilanjansiromani opened this issue Feb 21, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@nilanjansiromani
Copy link

nilanjansiromani commented Feb 21, 2020

We get an error when trying to compare two jsons

➜  product git:(bundle-stats-comparison) ✗ bundbundle-stats  --html  ./bundleStats/baseline.json ./bundleStats/bundle-stats.json 
  ✔ Read Webpack stats files
  ↓ Read baseline data [skipped]
    → Multiple stat files already set.
  ↓ Write baseline data [skipped]
    → Not a baseline job (see --baseline).
  ✖ Process data
    → Cannot read property 'split' of undefined
    Generate reports
    Save reports
TypeError: Cannot read property 'split' of undefined
    at getAssetName (/Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/assets/get-asset-name.js:17:35)
    at /Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/transforms/assets-webpack-transform.js:49:45
    at Array.reduce (<anonymous>)
    at assetsWebpackTransform (/Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/transforms/assets-webpack-transform.js:44:32)
    at createStats (/Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/stats/create.js:97:82)
    at createJob (/Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/jobs/create-job.js:53:41)
    at /Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/jobs/create-jobs.js:28:126
    at Array.reduce (<anonymous>)
    at createJobs (/Users/n0s00jx/codebase/work/product/node_modules/@bundle-stats/utils/lib/jobs/create-jobs.js:28:53)
    at Task.task (/Users/n0s00jx/codebase/work/product/node_modules/bundle-stats/bin/run.js:84:27) {
  context: [Object: null prototype] { artifacts: [ [Object], [Object] ] }
}
@vio vio added the bug Something isn't working label Feb 21, 2020
@vio
Copy link
Member

vio commented Feb 21, 2020

Hi @nilanjansiromani, thanks for raising this!

Will try to investigate, but can you please share more details about your setup ?

  1. version of bundle-stats / webpack / node
  2. any errors when running bundle-stats --demo
  3. webpack stats files

@vio
Copy link
Member

vio commented Apr 13, 2020

@nilanjansiromani I was able to replicate the error when passing invalid webpack stats. The latest version (2.2.0) is going to validate the entire structure and give you an error message.

Feel free to re-open this issue if you still have problems.

@vio vio closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants