Axios not working with webpack target: 'node'
#18354
Unanswered
pradyuman-verma
asked this question in
Q&A
Replies: 1 comment
-
Can you provide reproducible test repo? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I have a service in which users provide me with js code, and I build it using Webpack. I have been using
target: 'web' (default)
for a while but when a user tried to call 'Axios' inside its code, I got an error like this:After researching a bit, I found that I needed to compile the code with
target: node
, I tried that as well. But then I got the error:Cannot find module 'util'
I tried passing util module as a fallback as well. But no luck there as well. Help me how to run
axios
requests inside webpack.This is my webpack.config.js (webpack version - 5.91.0)
Beta Was this translation helpful? Give feedback.
All reactions