codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 222 forks source link

TypeScript version conflict between karma-webpack and angular 6 #331

Closed seanforyou23 closed 6 years ago

seanforyou23 commented 6 years ago

I'm submitting a bug report

Webpack version: ^4.10.2

Webpack Karma version: ^3.0.0

Karma version: ^2.0.2

Please tell us about your environment: OSX 10.13.4

Browser: Actual Browser: Chrome 66.0.3359.181 (Official Build) (64-bit) Testing Browser: Chrome 67.0.3396.62 (Official Build) (64-bit)

Current behavior: @angular/core@^6.0.2 and karma-webpack@^3.0.0 require conflicting version of typescript (2.8.1 vs 2.7.2)

Expected/desired behavior: Latest karma-webpack and angular can co-exist using a same version of typescript without error

Steps to reproduce: 1) git clone git@github.com:seanforyou23/ng6-webpack-karma.git 2) cd ng6-webpack-karma/ && npm install && npm run build && npm run start:demo 3) Notice everything is working fine 4) npm run test // Notice karma fails to start 5) npm install typescript@2.8.1 && npm run test 6) Notice karma can now properly start and tests run fine 7) npm run build // But now angular isn't happy, and build does not run

Minimal demo app: https://github.com/seanforyou23/ng6-webpack-karma

Webpack Configs Test Config: https://gist.github.com/seanforyou23/c723e867fac3953662f8c66810b0ec7f Demo Config: https://gist.github.com/seanforyou23/0973f180025092c91d944f88ac028efe

If I've overlooked some configuration or have a bug elsewhere in the code that's contributing to this error, please forgive me in advance! Thank you for looking into this!

emilio-martinez commented 6 years ago

@seanforyou23 karma-webpack doens't require typescript at all. See: https://github.com/webpack-contrib/karma-webpack/blob/v3.0.0/package.json#L27-L59

seanforyou23 commented 6 years ago

@emilio-martinez thanks, I totally missed that before. With that out of the way, I was able to find that by replacing awesome-typescript-loader with ts-loader the error goes away.

Thanks for taking the time to look into this, your comment helped get me back on track.