Some time ago i installed webpack-dev-server v3.11.0 in my project, which - as i recently checked - has http-proxy-middleware v0.19.1 as dependency. It has worked ok until i separately installed http-proxy-middleware package, but in v1.1.1. Now, when i build the TS project, it throws the following errors:
node_modules/@types/webpack-dev-server/index.d.ts:30:53 - error TS2694: Namespace '"E:/Pro
jects/shop/node_modules/http-proxy-middleware/dist/index"' has no exported me
mber 'Config'.
30 [url: string]: string | httpProxyMiddleware.Config;
~~~~~~
node_modules/@types/webpack-dev-server/index.d.ts:36:29 - error TS2694: Namespace '"E:/Pro
jects/shop/node_modules/http-proxy-middleware/dist/index"' has no exported me
mber 'Config'.
36 } & httpProxyMiddleware.Config;
~~~~~~
Apparently, webpack-dev-server now uses the standalone http-proxy-middleware v1.1.1, which i installed, instead of it's default subdependent v0.19.1, which differs (at least) in exported things.
$ npm ls http-proxy-middleware
shop@1.0.0 E:\Projects\shop
+-- http-proxy-middleware@1.1.2
`-- webpack-dev-server@3.11.0
`-- http-proxy-middleware@0.19.1
Is there a way, to force webpack-dev-server to still use it's subdependency v0.19.1 while i will be able to use v1.1.1? Or is there a better way that i could use the newer version without such issues?
I read about shrinkwrap, but it seems to be an overkill for that case with just one conflicting package - but maybe i am wrong.
[update]
As a workaround i removed standalone http-proxy-middleware v1.1.1 package and used webpack-dev-server dependency package in my module. However i don't think this is the solution for problem, so i'd like to know how to do it properly.