Reactgo: Issue with using request package

Created on 1 Aug 2017  路  4Comments  路  Source: reactGo/reactGo

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.

Most helpful comment

ah you are using it in the client environment. Then I think using axios instead of request is better

All 4 comments

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. (app.js:2124)
at __webpack_require__ (app.js:621)
at fn (app.js:47)
at eval (webpack:///../~/tough-cookie/lib/cookie.js?:32)
at Object. (app.js:6915)
at __webpack_require__ (app.js:621)
at fn (app.js:47)
at eval (webpack:///../~/request/lib/cookies.js?:3)
at Object. (app.js:3201)

ah you are using it in the client environment. Then I think using axios instead of request is better

okay, axios works, thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thientran1707 picture thientran1707  路  5Comments

choonkending picture choonkending  路  9Comments

psimyn picture psimyn  路  6Comments

choonkending picture choonkending  路  4Comments

evansteelepdx picture evansteelepdx  路  3Comments