Replies: 8 comments
-
(New here and I just going through the source code, so take my advice with pinch of salt) I see that this module is being used by However, the |
Beta Was this translation helpful? Give feedback.
-
Same problem here, but it's working fine if you ignore the warning. |
Beta Was this translation helpful? Give feedback.
-
Axios is an isomorphic library. This error indicates that your build tool is not configured properly to build the client-related code, instead, it tries to build the Node.js version of Axios and then use it on the client, polyfilling the node.js dependencies. Axios for browsers does not have any dependencies. |
Beta Was this translation helpful? Give feedback.
-
I'm using Next.js and Axios on the client-side. Can someone explain the specific implications and benefits of incorporating Axios within a Next.js application for client-side requests? |
Beta Was this translation helpful? Give feedback.
-
The problem comes with the
By doing this you remove this alert but a new appears:
There is an issue with
This worked for me, hope its works for you two : ) |
Beta Was this translation helpful? Give feedback.
-
Same problem, have you found the solution, guys? |
Beta Was this translation helpful? Give feedback.
-
I use yarn berry and I got a similar warning. I fixed it by adding the following config to
|
Beta Was this translation helpful? Give feedback.
-
This (followed by packageExtensions:
follow-redirects@*:
dependencies:
debug: "*"
debug@*:
dependencies:
supports-color: "*" |
Beta Was this translation helpful? Give feedback.
-
Section/Content To Improve
I am using Next.js 13.4.2 and Axios 1.4.0 for my current project and encountering an issue while running my project in dev mode. As soon as I import axios (still everything fine) and then try to fetch som data, it shows me a warn inside the console:
Module not found: Can't resolve 'debug' in '\node_modules\follow-redirects'
The error suggests using './debug' instead of 'debug' and mentions that requests starting with a name are treated as module requests. However, changing the source code is not an option for me as I dont wanna perform code changes inside node_moduels
Here is the import trace for the requested module:
./node_modules/follow-redirects/debug.js ./node_modules/follow-redirects/index.js ./node_modules/axios/lib/adapters/http.js ./node_modules/axios/lib/adapters/adapters.js ./node_modules/axios/lib/core/dispatchRequest.js ./node_modules/axios/lib/core/Axios.js ./node_modules/axios/lib/axios.js ./node_modules/axios/index.js ./src/components/login/LoginForm.tsx
Suggested Improvement
I would appreciate any guidance or suggestions on how to resolve this issue without modifying the source code. I've heard there is a resolve option called 'preferRelative' that might help in resolving these kinds of requests in the current directory. Can someone please explain how to use this resolve option or provide an alternative solution? Thank you.
Relevant File(s)
No response
Beta Was this translation helpful? Give feedback.
All reactions