s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 179 forks source link

Please provide peerDependency for webpack version #611

Open fuzzykiller opened 6 years ago

fuzzykiller commented 6 years ago

Currently, I can install the latest version (5.2.0) of awesome-typescript-loader in combination with Webpack 2.2.x with no warning whatsoever.

When running Webpack however, it all falls apart:

...\node_modules\awesome-typescript-loader\src\watch-mode.ts:5
                compiler.hooks.run.tapAsync('at-loader', function(params, callback) {
                 ^
TypeError: Cannot read property 'run' of undefined
    at CheckerPlugin.apply (...\node_modules\awesome-typescript-loader\src\watch-mode.ts:5:18)
    at Compiler.apply (...\node_modules\tapable\lib\Tapable.js:375:16)
    at webpack (...\node_modules\webpack\lib\webpack.js:32:19)
    at options.map.options (...\node_modules\webpack\lib\webpack.js:23:55)
    at Array.map (<anonymous>)
    at webpack (...\node_modules\webpack\lib\webpack.js:23:40)
    at processOptions (...\node_modules\webpack\bin\webpack.js:305:14)
    at Object.<anonymous> (...\node_modules\webpack\bin\webpack.js:363:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

That’s because there’s no compiler.hooks in Webpack 2.x.

This problem could easily be prevented by specifying compatible Webpack versions in package.json.

gruckion commented 5 years ago

Also having this issue, needed to update webpack to 4+.