Preact-cli: preact build --analyze not working

Created on 19 Apr 2019  Â·  1Comment  Â·  Source: preactjs/preact-cli


Do you want to request a _feature_ or report a _bug_?

A bug.

What is the current behaviour?

Command preact build --analyze is not working, it throws an error after successfully making a build.

If the current behaviour is a bug, please provide the steps to reproduce.

Create a "build:analyze": "preact build --analyze", entry in the scripts section at package.json, then run npm run build:analyze. The build process ends just fine but then the following error is immediately displayed and the process is interrupted:

...

Critters: inlined 214 B (100% of original 212 B) of bundle.e1dd1.css.
✖ ERROR TypeError: Cannot read property 'hasErrors' of undefined
    at showStats (/Users/desko27/Code/GitHub/project/node_modules/preact-cli/lib/lib/webpack/run-webpack.js:118:12)
    at compiler.run (/Users/desko27/Code/GitHub/project/node_modules/preact-cli/lib/lib/webpack/run-webpack.js:106:4)
    at finalCallback (/Users/desko27/Code/GitHub/project/node_modules/webpack/lib/Compiler.js:220:39)
    at hooks.done.callAsync.err (/Users/desko27/Code/GitHub/project/node_modules/webpack/lib/Compiler.js:268:23)
    at _err1 (eval at create (/Users/desko27/Code/GitHub/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
    at Immediate.<anonymous> (/Users/desko27/Code/GitHub/project/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:79:13)
    at Generator.throw (<anonymous>)
    at asyncGeneratorStep (/Users/desko27/Code/GitHub/project/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:3:103)
    at _throw (/Users/desko27/Code/GitHub/project/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:5:291)
    at <anonymous>
    at runMicrotasksCallback (internal/process/next_tick.js:122:5)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickCallback (internal/process/next_tick.js:181:9)

What is the expected behaviour?

The following web app should be served on 8888 port, as stated in the PR which introduced the feature.
Webpack Bundle Analyzer

If this is a feature request, what is motivation or use case for changing the behaviour?

-

Please mention other relevant information.

  • preact-cli version: 3.0.0-rc.1
  • Node version: 8.15.0
  • npm version: 6.4.1
  • Operating system: macOS Mojave 10.14.3 (18D109)
  • CLI version: iTerm2 3.2.8
  • Browser: 73.0.3683.103 (Official Build) (64-bit)
bug

Most helpful comment

the update in this repo is still pending and one more small bug i discovered on the way

>All comments

the update in this repo is still pending and one more small bug i discovered on the way

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlStar01 picture AlStar01  Â·  3Comments

higimo picture higimo  Â·  3Comments

oren picture oren  Â·  4Comments

haggen picture haggen  Â·  3Comments

scottmas picture scottmas  Â·  3Comments