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

#No Bundles Parsed# #340

Closed
Romicodes opened this issue Mar 16, 2020 · 5 comments
Closed

#No Bundles Parsed# #340

Romicodes opened this issue Mar 16, 2020 · 5 comments

Comments

@Romicodes
Copy link

Romicodes commented Mar 16, 2020

Issue description

...
@valscion
Getting the following error message when trying to create a npm run build

No bundles were parsed. Analyzer will show only original module sizes from stats file.

Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it

Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 4968172b96b83b06dca5
Version: webpack 4.42.0
Time: 58ms
Built at: 03/16/2020 4:48:31 PM

ERROR in Entry module not found: Error: Can't resolve './src' in 'C:\Users\romibabe\documents\firefox**********************

Technical info

  • Webpack Bundle Analyzer version: 3.6.1
  • Webpack version: 4
  • Node.js version: 12.6.1
  • npm/yarn version:
  • OS: Windows

Debug info

How do you use this module? As CLI utility or as plugin? Plugin

If CLI, what command was used? (e.g. webpack-bundle-analyzer -O path/to/stats.json)

If plugin, what options were provided? (e.g. new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true }))

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
  plugins: [
    new BundleAnalyzerPlugin()
  ]
}

What other Webpack plugins were used?

"webpack": "^4",
    "webpack-bundle-analyzer": "^3.6.1",
    "webpack-cli": "^3",
    "webpack-dev-server": "^3"

It would be nice to also attach webpack stats file.
It can be generated using these options:

new BundleAnalyzerPlugin({
  analyzerMode: 'disabled',
  generateStatsFile: true,
  // Excludes module sources from stats file so there won't be any sensitive data
  statsOptions: { source: false }
})

stats.json will be created in Webpack bundle output directory.

@valscion
Copy link
Member

Hi, thanks for opening the issue.

This part of the command output seems interesting:

Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

It seems like webpack itself is unable to generate your bundle. When webpack fails to generate a bundle, webpack-bundle-analyzer won't have output files to read the bundle contents from.

@Romicodes
Copy link
Author

Romicodes commented Mar 18, 2020

Hello @valscion , Thank you for your feedback! I did make a couple of changes ,end up with a successful compile and the following, but still no parsed files?

$ npm run start

> platform-health-dashboard@0.0.1 start C:\Users\romibabe\docu
> webpack-dev-server --mode development

i 「wds」: Project is running at http://localhost:8080/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\romi
Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it
i 「wdm」: Hash: 7d4f68754733837952ff
Version: webpack 4.42.0
Time: 536ms
Built at: 03/17/2020 11:12:10 PM
  Asset     Size  Chunks             Chunk Names
main.js  363 KiB    main  [emitted]  main
Entrypoint main = main.js
[0] multi (webpack)-dev-server/client?http://localhost:8080 ./
[./node_modules/ansi-html/index.js] C:/Users/romibabe/Document
[./node_modules/html-entities/index.js] C:/Users/romibabe/Docu
[./node_modules/loglevel/lib/loglevel.js] C:/Users/romibabe/Do
[./node_modules/url/url.js] C:/Users/romibabe/Documents/firefo
[./node_modules/webpack-dev-server/client/index.js?http://loca
[./node_modules/webpack-dev-server/client/overlay.js] (webpack
[./node_modules/webpack-dev-server/client/socket.js] (webpack)
[./node_modules/webpack-dev-server/client/utils/createSocketUr
[./node_modules/webpack-dev-server/client/utils/log.js] (webpa
[./node_modules/webpack-dev-server/client/utils/reloadApp.js]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js
[./node_modules/webpack-dev-server/node_modules/strip-ansi/ind
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync
./src/index.js] 29 bytes {main} [built]
   + 18 hidden modules
 「wdm」: Compiled successfully.

@th0r
Copy link
Collaborator

th0r commented Mar 18, 2020

Read Troubleshooting section of the readme please.

@th0r th0r closed this as completed Mar 18, 2020
@valscion
Copy link
Member

th0r is referencing this section: https://github.com/webpack-contrib/webpack-bundle-analyzer#i-dont-see-gzip-or-parsed-sizes-it-only-shows-stat-size

Looks like you're using webpack-dev-server. That's why you don't have bundles to parse, as no files are emitted. See the readme, #191 and #147 for example.

@HAOFUYANG
Copy link

When I used npm scripts to build my Vue 2 project, the JavaScript files in the 'dist' directory were not minified, and remained at their original size,only stat,not have parsed and gzip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants