-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module not found: Can't resolve 'debug' in 'follow-redirects' #5716
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 |
Same problem here, but it's working fine if you ignore the warning. |
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. |
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? |
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 : ) |
Same problem, have you found the solution, guys? |
I use yarn berry and I got a similar warning. I fixed it by adding the following config to
|
This (followed by packageExtensions:
follow-redirects@*:
dependencies:
debug: "*"
debug@*:
dependencies:
supports-color: "*" |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
The text was updated successfully, but these errors were encountered: