wbuchwalter / tslint-loader

tslint loader for webpack
193 stars 65 forks source link

Error with webpack 4 #99

Closed eswarasai closed 6 years ago

eswarasai commented 6 years ago

I've recently upgraded the webpack version to 4 which is throwing the below error when I try to run the app using webpack-dev-server in the development mode. I haven't changed any config of the webpack. Is there something that needs to be updated in the webpack config?

ERROR in ./index.tsx
Module build failed: TypeError: Cannot read property 'tslint' of undefined
    at resolveOptions (/node_modules/tslint-loader/index.js:24:47)
    at Object.module.exports (/node_modules/tslint-loader/index.js:139:17)
 @ multi ../node_modules/webpack-dev-server/client?http://0.0.0.0:3000 ./index.tsx
yoannmoinet commented 6 years ago

I have the same issue without using webpack-dev-server, but I am in development mode.

Is there anything done for this now that webpack has officially released v4?

yoannmoinet commented 6 years ago

After a bit of investigation, this is not possible anymore, you can't access the global config from a loader. I think it was to support webpack 1.

There's also this part that isn't possible as well. I'm not sure how you're supposed to get the bail config though.

yoannmoinet commented 6 years ago

Actually #95 is fixing this.

eswarasai commented 6 years ago

@yoannmoinet -- Thanks for pointing this out. Somehow when I've tried to do npm update, tslint-loader didn't update to 3.6.0. I've tested with 3.6.0 and the issue seems to be resolved. Closing this now.