webpack-bundle-analyzer: Error parsing bundle asset "*" no such file when mixing relative paths

Error parsing bundle asset “*” no such file when mixing relative paths

Looks like mixing paths for output stats.json and webpack entries causes this error.

Technical info

  • Webpack Bundle Analyzer version: 3.0.2
  • Webpack version: 4.6.15
  • Node.js version: 10.11.0
  • npm/yarn version: 6.4.1
  • OS: Archlinux

Debug info

Bundle analyzer is launched as npm script: webpack --profile --json > dist/stats.json && webpack-bundle-analyzer dist/stats.json

And webpack entries look like that:

    entry: {
        'otherplace/bundle1': ['*', '*'],
        'otherplace/bundle2': '*',
        'otherplace/bundle3': '*',
        'dist/bundle4': '.*',
        'dist/bundle5': '.*',
    },

So, when webpack --profile --json > dist/stats.json && webpack-bundle-analyzer dist/stats.json Errors like

Error parsing bundle asset "<absolute path>/dist/dist/bundle5.js": no such file (/dist/ appear twice)
Error parsing bundle asset "<absolute path>/dist/otherplace/bundle2": no such file (should be no /dist/, only /otherplace/)

appear, and no parsed size (only stat size) available, but when using webpack --profile --json > stats.json && webpack-bundle-analyzer stats.json everything works fine

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 17 (2 by maintainers)

Commits related to this issue

Most upvoted comments

always happen in webpack5

A possible workaround to make it work, in case you have an output directory named dist:

webpack --profile --json > stats.json && webpack-bundle-analyzer stats.json dist/

@vnues Can you provide example of the problem?

hello,This is my project, you can perform the following steps

git clone git@github.com:art-design-ui/noov.js.git
npm i
npm run dev

The following prompt will occur

image

same issue here. local macos builds fine, and remote CI produces this error saying:

Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/vue-loader/lib/loaders/stylePostLoader.js!node_modules/sass-loader/lib/loader.js!node_modules/vue-loader/lib/index.js??vue-loader-options!src/views/Video.page.vue?vue&type=style&index=0&id=01422a34&scoped=true&lang=css&:
    Entrypoint mini-css-extract-plugin = *
    [0] ./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Video.page.vue?vue&type=style&index=0&id=01422a34&scoped=true&lang=css& 162 bytes {0} [built]
        + 1 hidden module
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/vendors.cb3f9722098fcd2c8907.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/1.c26fe07aa377bd74cdf2.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/app.e5b23854adf630ec7091.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/3.902eabc18fbeb40958b0.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/4.e7e88988441cd90f96ea.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/5.706427295ce3457d8589.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/6.adf191adef5bc477f936.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/7.83db1aa0a0f4751e3f03.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/8.8dd0451db14c6295a8db.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/9.39df996a12dec23833f6.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/10.bdb90602a0cd2b799d62.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/11.7dd6ec8635d6f9a72611.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/12.fc237f1f81c92dc8330f.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/13.a377c93a2452a355bb3f.js": no such file
Error parsing bundle asset "/builds/xxxxxx/backend/resources/dist/assets/js/runtime.9b6506fc815dcb500655.js": no such file

webpack version not locked using "webpack": "^4.16.5",

@vnues Can you provide example of the problem?