jantimon / html-webpack-harddisk-plugin

Write html files to hard disk even when using the webpack dev server or middleware
MIT License
225 stars 40 forks source link

Cannot read property 'alwaysWriteToDisk' of undefined #35

Closed Thebarda closed 4 years ago

Thebarda commented 4 years ago

After upgrading webpack@5.1.2, webpack-cli@4.0.0 and html-webpack-plugin@5.0.0-alpha.3, I have the following error when building in production / development mode

TypeError: Cannot read property 'alwaysWriteToDisk' of undefined
    at HtmlWebpackHarddiskPlugin.writeAssetToDisk (C:\Users\tdarneix\Development\centreon-dev-ecosystem-wp5\centreon\node_modules\html-webpack-harddisk-plugin\index.js:46:33)
    at C:\Users\tdarneix\Development\centreon-dev-ecosystem-wp5\centreon\node_modules\html-webpack-harddisk-plugin\index.js:27:16
    at eval (eval at create (C:\Users\tdarneix\Development\centreon-dev-ecosystem-wp5\centreon\node_modules\html-webpack-plugin\node_modules\tapable\lib\HookCodeFactory.js:74:10), <anonymous>:15:1)       
    at new Promise (<anonymous>)
    at Hook.eval [as promise] (eval at create (C:\Users\tdarneix\Development\centreon-dev-ecosystem-wp5\centreon\node_modules\html-webpack-plugin\node_modules\tapable\lib\HookCodeFactory.js:74:10), <anonymous>:4:8)
    at Hook.PROMISE_DELEGATE [as _promise] (C:\Users\tdarneix\Development\centreon-dev-ecosystem-wp5\centreon\node_modules\html-webpack-plugin\node_modules\tapable\lib\Hook.js:22:14)
    at C:\Users\tdarneix\Development\centreon-dev-ecosystem-wp5\centreon\node_modules\html-webpack-plugin\index.js:341:89
    at runMicrotasks (<anonymous>)

Does the alwaysWriteToDisk is still available on html-webpack-plugin ? Is there a way to wirte assets to disk no matter the build type ?

jantimon commented 4 years ago

Actually that's a problem with the html-webpack-plugin@5.0.0-alpha.3 ... I need to see if it can be fixed easily 🤔

Thebarda commented 4 years ago

Yeah I didn't know in which repo to this issue ^^ I can create another issue in html-webpack-plugin and close this one if it easier to you to track issues :)

jantimon commented 4 years ago

Can you please try html-webpack-plugin@5.0.0-alpha.5 ?

Thebarda commented 4 years ago

Looks good. My assets are now written to disk. Sorry for the latency 😃

jantimon commented 4 years ago

Cool thanks for testing 👍