I am trying to use the request module, but am getting the same errors as:
https://github.com/request/request/issues/1691
I've tried changing the config.node, but it doesn't work. Is there anything else I can do? Thanks.
Have you tried target: 'node'
Yes, I have tried adding that in devBrowerRender in webpack.config.js, but then I get another error in the browser, and the app doesn't work:
Uncaught ReferenceError: require is not defined
at eval (webpack:///external_%22net%22?:1)
at Object.
at __webpack_require__ (app.js:621)
at fn (app.js:47)
at eval (webpack:///../~/tough-cookie/lib/cookie.js?:32)
at Object.
at __webpack_require__ (app.js:621)
at fn (app.js:47)
at eval (webpack:///../~/request/lib/cookies.js?:3)
at Object.
ah you are using it in the client environment. Then I think using axios instead of request is better
okay, axios works, thank you.
Most helpful comment
ah you are using it in the client environment. Then I think using
axiosinstead of request is better