'Can't resolve 'process/browser' in ...' error with webpack 5 + yarn PnP

Viewed 286

I'm trying Webpack 5 with yarn PnP. (+ yarn workspace, I'm not sure it's relevant to this issue)

I should let Webpack resolve the package 'process', so I put new ProvidePlugin({ process: 'process/browser' }) in my Webpack configuration. It works well with my Project code, but not with its dependencies.

It throws an error that reads

Can't resolve 'process/browser' in '/Users/me/Documents/GitHub/kic2-all-in-one/.yarn/cache/axios-npm-0.19.2-e4e8599895-dcace11a0a.zip/node_modules/axios/lib'

I think that it's due to the usages of 'process' in Axios code. And I'm not sure if I can let it resolve in the way I want. Do we have any? If not, do we have any workaround?

0 Answers
Related