webpack-dev-middleware icon indicating copy to clipboard operation
webpack-dev-middleware copied to clipboard

Webpack stats are printed twice

Open testerez opened this issue 8 years ago • 4 comments

  • Operating System: macos 10.13.2
  • Node Version: v8.5.0
  • NPM Version: 5.6.0
  • webpack version: 3.10.0
  • webpack-dev-middleware Version: 2.0.4
  • [ ] This is a feature request
  • [x] This is a bug

Code

import * as express from 'express';
import * as webpack from 'webpack';
import config from 'config';
import * as devMiddleware from 'webpack-dev-middleware';
import * as hotMiddleware from 'webpack-hot-middleware';

const webpackConfig = require('./dev.config');
const compiler = webpack(webpackConfig);

const port = config.port + 1;

const app = express();

app.use(devMiddleware(compiler, {
  publicPath: webpackConfig.output.publicPath,
}));

app.use(hotMiddleware(compiler));

app.listen(port, (error: any) => {
  if (error) {
    console.error(error);
  } else {
    console.info('==> 🚧  Webpack development server listening on port %s', port);
  }
});

Since I update from 1.12.1 to 2.0.4 webpack stats are printed twice in the console when I start the server. Not a big deal as it's still working but seams like an unexpected behaviour. Here is my output:

==> 🚧  Webpack development server listening on port 3001
(node:39361) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead.
Hash: 2306b91a3bb4e581e9dc
Version: webpack 3.10.0
Time: 12345ms
                                        Asset     Size  Chunks                    Chunk Names
             GT-Walsheim-Medium-3a529c0d.woff  75.8 kB          [emitted]
                background-cello-c9f238f2.jpg   135 kB          [emitted]
                               2-275f1cbe.jpg   101 kB          [emitted]
                               3-82a770c9.jpg  89.9 kB          [emitted]
                               4-6c402bac.jpg   108 kB          [emitted]
                               5-d2305311.jpg   118 kB          [emitted]
                               6-94289474.jpg  93.1 kB          [emitted]
                               7-83d73183.jpg  74.8 kB          [emitted]
                               8-770f1f06.jpg   110 kB          [emitted]
                               9-176b1ea7.jpg   120 kB          [emitted]
                              10-6cfce745.jpg   102 kB          [emitted]
          4ba83bcd72f28a3f615472151205cebd.js   321 kB          [emitted]  [big]
           cloudscape_collection-d2428a11.png   197 kB          [emitted]
        ExpertSongListBackground-1e2c9861.jpg  88.8 kB          [emitted]
                         headset-a9710621.png   144 kB          [emitted]
           mailingListBackground-10e91ac2.jpg  41.4 kB          [emitted]
                          paypal-9d852cf8.svg  6.39 kB          [emitted]
                            amex-276d4dc3.svg  3.22 kB          [emitted]
                            visa-49304258.svg  3.46 kB          [emitted]
                      mastercard-22898f9b.svg  3.21 kB          [emitted]
                   inner-macbook-9971d5c8.jpg   142 kB          [emitted]
              notFoundBackground-57d73d93.jpg  64.6 kB          [emitted]
                           vinyl-d2627978.png   115 kB          [emitted]
                      footer-FAQ-9a6838d6.jpg   134 kB          [emitted]
        GT-Walsheim-Ultra-Light-43199cd6.woff  70.9 kB          [emitted]
GT-Walsheim-Ultra-Light-Oblique-526800c9.woff    75 kB          [emitted]
               GT-Walsheim-Thin-d26e2e3b.woff  74.5 kB          [emitted]
              GT-Walsheim-Light-2af43e56.woff  75.8 kB          [emitted]
            GT-Walsheim-Regular-c25af586.woff  80.4 kB          [emitted]
    GT-Walsheim-Regular-Oblique-c410104f.woff  84.7 kB          [emitted]
                               1-61c4b2ba.jpg   101 kB          [emitted]
               GT-Walsheim-Bold-10153319.woff    78 kB          [emitted]
       GT-Walsheim-Bold-Oblique-3ff89be7.woff  81.6 kB          [emitted]
              GT-Walsheim-Black-d4be20ce.woff  77.4 kB          [emitted]
         GT-Walsheim-Ultra-Bold-85ef7961.woff  76.2 kB          [emitted]
 GT-Walsheim-Ultra-Bold-Oblique-7cefdecb.woff  80.7 kB          [emitted]
                    hero-console-bebee438.jpg  55.3 kB          [emitted]
              SongPageBackground-506769fa.jpg  25.2 kB          [emitted]
                        cuesheet-dd7cc993.pdf  81.2 kB          [emitted]
               Hero-promo-laptop-cc9177e3.jpg   125 kB          [emitted]
                     Hero-guitar-aa93f110.jpg  70.9 kB          [emitted]
      inner-camera+headset-right-ffd95c72.jpg   115 kB          [emitted]
                    Hero-AboutUs-c93c794c.jpg   144 kB          [emitted]
               inner-lapTop-SSTK-66386e54.jpg   136 kB          [emitted]
                    full-console-a4294be3.jpg   103 kB          [emitted]
                 pro-white-logos-a9bbcd36.png  12.5 kB          [emitted]
       inner-guitarElectric-left-6689e6ed.jpg   114 kB          [emitted]
                   inner-macbook-68237c31.jpg   112 kB          [emitted]
                  Hero-ContactUs-e41a2842.jpg   114 kB          [emitted]
                        Hero-FAQ-370888d7.jpg   100 kB          [emitted]
                  Hero-keyboard2-0591149c.jpg   102 kB          [emitted]
         Sample-Standard-License-0c69f450.pdf    11 MB          [emitted]  [big]
          Sample-Premium-License-381f2b86.pdf  5.03 MB          [emitted]  [big]
                        Hero-SFX-ac7f3bda.jpg  87.2 kB          [emitted]
                 main-2306b91a3bb4e581e9dc.js  3.67 MB       0  [emitted]  [big]  main
               vendor-2306b91a3bb4e581e9dc.js  2.22 MB       1  [emitted]  [big]  vendor
             manifest-2306b91a3bb4e581e9dc.js  31.3 kB       2  [emitted]         manifest
             main-2306b91a3bb4e581e9dc.js.map  4.09 MB       0  [emitted]         main
           vendor-2306b91a3bb4e581e9dc.js.map  2.51 MB       1  [emitted]         vendor
         manifest-2306b91a3bb4e581e9dc.js.map  33.6 kB       2  [emitted]         manifest
   [0] (webpack)/buildin/harmony-module.js 596 bytes {1} [built]
   [1] ./node_modules/react/index.js 190 bytes {1} [built]
 [592] multi react-hot-loader/patch webpack-hot-middleware/client?path=http://localhost:3001/__webpack_hmr ./src/client/client.tsx 52 bytes {0} [built]
 [593] ./node_modules/react-hot-loader/patch.js 40 bytes {1} [built]
 [594] ./node_modules/react-hot-loader/lib/patch.js 209 bytes {1} [built]
 [701] (webpack)-hot-middleware/client.js?path=http://localhost:3001/__webpack_hmr 7.35 kB {1} [built]
 [702] ./node_modules/querystring-es3/index.js 127 bytes {1} [built]
 [705] ./node_modules/strip-ansi/index.js 161 bytes {1} [built]
 [707] (webpack)-hot-middleware/client-overlay.js 2.21 kB {1} [built]
 [712] (webpack)-hot-middleware/process-update.js 4.33 kB {1} [built]
 [713] ./src/client/client.tsx 1.89 kB {0} [built]
 [714] ./src/client/outdatedBrowser/blockOutdatedBrowsers.ts 1.65 kB {0} [built]
 [730] ./node_modules/react-hot-loader/index.js 40 bytes {1} [built]
[1603] ./src/client/migratePBv3Cart.ts 1.54 kB {0} [built]
[1605] ./src/client/detectKeyboardUser.ts 1.88 kB {0} [built]
    + 1591 hidden modules
webpack built 2306b91a3bb4e581e9dc in 12345ms
ℹ 「wdm」: Hash: 2306b91a3bb4e581e9dc
Version: webpack 3.10.0
Time: 12345ms
                                        Asset     Size  Chunks                    Chunk Names
             GT-Walsheim-Medium-3a529c0d.woff  75.8 kB          [emitted]
                background-cello-c9f238f2.jpg   135 kB          [emitted]
                               2-275f1cbe.jpg   101 kB          [emitted]
                               3-82a770c9.jpg  89.9 kB          [emitted]
                               4-6c402bac.jpg   108 kB          [emitted]
                               5-d2305311.jpg   118 kB          [emitted]
                               6-94289474.jpg  93.1 kB          [emitted]
                               7-83d73183.jpg  74.8 kB          [emitted]
                               8-770f1f06.jpg   110 kB          [emitted]
                               9-176b1ea7.jpg   120 kB          [emitted]
                              10-6cfce745.jpg   102 kB          [emitted]
          4ba83bcd72f28a3f615472151205cebd.js   321 kB          [emitted]  [big]
           cloudscape_collection-d2428a11.png   197 kB          [emitted]
        ExpertSongListBackground-1e2c9861.jpg  88.8 kB          [emitted]
                         headset-a9710621.png   144 kB          [emitted]
           mailingListBackground-10e91ac2.jpg  41.4 kB          [emitted]
                          paypal-9d852cf8.svg  6.39 kB          [emitted]
                            amex-276d4dc3.svg  3.22 kB          [emitted]
                            visa-49304258.svg  3.46 kB          [emitted]
                      mastercard-22898f9b.svg  3.21 kB          [emitted]
                   inner-macbook-9971d5c8.jpg   142 kB          [emitted]
              notFoundBackground-57d73d93.jpg  64.6 kB          [emitted]
                           vinyl-d2627978.png   115 kB          [emitted]
                      footer-FAQ-9a6838d6.jpg   134 kB          [emitted]
        GT-Walsheim-Ultra-Light-43199cd6.woff  70.9 kB          [emitted]
GT-Walsheim-Ultra-Light-Oblique-526800c9.woff    75 kB          [emitted]
               GT-Walsheim-Thin-d26e2e3b.woff  74.5 kB          [emitted]
              GT-Walsheim-Light-2af43e56.woff  75.8 kB          [emitted]
            GT-Walsheim-Regular-c25af586.woff  80.4 kB          [emitted]
    GT-Walsheim-Regular-Oblique-c410104f.woff  84.7 kB          [emitted]
                               1-61c4b2ba.jpg   101 kB          [emitted]
               GT-Walsheim-Bold-10153319.woff    78 kB          [emitted]
       GT-Walsheim-Bold-Oblique-3ff89be7.woff  81.6 kB          [emitted]
              GT-Walsheim-Black-d4be20ce.woff  77.4 kB          [emitted]
         GT-Walsheim-Ultra-Bold-85ef7961.woff  76.2 kB          [emitted]
 GT-Walsheim-Ultra-Bold-Oblique-7cefdecb.woff  80.7 kB          [emitted]
                    hero-console-bebee438.jpg  55.3 kB          [emitted]
              SongPageBackground-506769fa.jpg  25.2 kB          [emitted]
                        cuesheet-dd7cc993.pdf  81.2 kB          [emitted]
               Hero-promo-laptop-cc9177e3.jpg   125 kB          [emitted]
                     Hero-guitar-aa93f110.jpg  70.9 kB          [emitted]
      inner-camera+headset-right-ffd95c72.jpg   115 kB          [emitted]
                    Hero-AboutUs-c93c794c.jpg   144 kB          [emitted]
               inner-lapTop-SSTK-66386e54.jpg   136 kB          [emitted]
                    full-console-a4294be3.jpg   103 kB          [emitted]
                 pro-white-logos-a9bbcd36.png  12.5 kB          [emitted]
       inner-guitarElectric-left-6689e6ed.jpg   114 kB          [emitted]
                   inner-macbook-68237c31.jpg   112 kB          [emitted]
                  Hero-ContactUs-e41a2842.jpg   114 kB          [emitted]
                        Hero-FAQ-370888d7.jpg   100 kB          [emitted]
                  Hero-keyboard2-0591149c.jpg   102 kB          [emitted]
         Sample-Standard-License-0c69f450.pdf    11 MB          [emitted]  [big]
          Sample-Premium-License-381f2b86.pdf  5.03 MB          [emitted]  [big]
                        Hero-SFX-ac7f3bda.jpg  87.2 kB          [emitted]
                 main-2306b91a3bb4e581e9dc.js  3.67 MB       0  [emitted]  [big]  main
               vendor-2306b91a3bb4e581e9dc.js  2.22 MB       1  [emitted]  [big]  vendor
             manifest-2306b91a3bb4e581e9dc.js  31.3 kB       2  [emitted]         manifest
             main-2306b91a3bb4e581e9dc.js.map  4.09 MB       0  [emitted]         main
           vendor-2306b91a3bb4e581e9dc.js.map  2.51 MB       1  [emitted]         vendor
         manifest-2306b91a3bb4e581e9dc.js.map  33.6 kB       2  [emitted]         manifest
   [0] (webpack)/buildin/harmony-module.js 596 bytes {1} [built]
   [1] ./node_modules/react/index.js 190 bytes {1} [built]
 [592] multi react-hot-loader/patch webpack-hot-middleware/client?path=http://localhost:3001/__webpack_hmr ./src/client/client.tsx 52 bytes {0} [built]
 [593] ./node_modules/react-hot-loader/patch.js 40 bytes {1} [built]
 [594] ./node_modules/react-hot-loader/lib/patch.js 209 bytes {1} [built]
 [701] (webpack)-hot-middleware/client.js?path=http://localhost:3001/__webpack_hmr 7.35 kB {1} [built]
 [702] ./node_modules/querystring-es3/index.js 127 bytes {1} [built]
 [705] ./node_modules/strip-ansi/index.js 161 bytes {1} [built]
 [707] (webpack)-hot-middleware/client-overlay.js 2.21 kB {1} [built]
 [712] (webpack)-hot-middleware/process-update.js 4.33 kB {1} [built]
 [713] ./src/client/client.tsx 1.89 kB {0} [built]
 [714] ./src/client/outdatedBrowser/blockOutdatedBrowsers.ts 1.65 kB {0} [built]
 [730] ./node_modules/react-hot-loader/index.js 40 bytes {1} [built]
[1603] ./src/client/migratePBv3Cart.ts 1.54 kB {0} [built]
[1605] ./src/client/detectKeyboardUser.ts 1.88 kB {0} [built]
    + 1591 hidden modules
ℹ 「wdm」: Compiled successfully.```

testerez avatar Jan 09 '18 06:01 testerez

Same problem here. Anyone found a cause of it?

saidkholov avatar Jan 24 '18 23:01 saidkholov

Can look into it

evenstensberg avatar Jan 25 '18 15:01 evenstensberg

This is a known issue with webpack-dev-middleware, and it's related to https://github.com/webpack/watchpack/issues/25. There's no hard, consistent number of times it'll reprint stats, as it's a function of OS, system settings, and config.

We have a PR prepped (#250) in the event that @sokra doesn't get around to resolving that in watchpack - but we're giving him some time to sort that out. @testerez Look for #250 to be merged on or around Feb 10th if the watchpack fix is still pending.

shellscape avatar Jan 29 '18 18:01 shellscape

thanks for checking out @shellscape

evenstensberg avatar Jan 29 '18 20:01 evenstensberg