Awhile back, I integrated webpack-dev-server
v3.11.0 into my project, which - upon recent inspection - relies on http-proxy-middleware
v0.19.1 as a dependency. Everything was running smoothly until I separately installed the http-proxy-middleware
package at version 1.1.1. Now, when I attempt to build the TypeScript 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;
~~~~~~
Evidently, webpack-dev-server
is now using the standalone http-proxy-middleware
v1.1.1 that I installed instead of its default sub-dependent v0.19.1, which differs in the exported elements.
$ npm ls http-proxy-middleware
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a2d1cacdd2e2938c928c92">[email protected]</a> E:\Projects\shop
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e088949490cd90928f98984b9ad8dbdde88b56ee82fe95">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7b0c1e190b1a1810561f1e0d56081e090d1e093b48554a4a554b">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c7468686c316c6e736465317175787870796b7d6e795c2c322d25322d">[email protected]</a>
Is there a way to instruct webpack-dev-server
to continue using its subdependency v0.19.1 while allowing me to utilize v1.1.1? Or is there a more effective method to incorporate the newer version without encountering such issues?
I came across shrinkwrap as a possible solution, but it feels excessive for just one conflicting package - though I could be mistaken.
[update]
To temporarily resolve the issue, I removed the standalone http-proxy-middleware
v1.1.1 package and utilized the webpack- dev-server
dependency package within my module. However, I believe this is not the ideal resolution, so I am seeking guidance on how to address the situation properly.