axios-logger
axios-logger copied to clipboard
V2.8.0 Introduces incompatibilities with web and react native
Describe the bug When running the app in react-native, I get the following error
/Users/me/workspace/origamirisk/origami-flex/node_modules/axios-logger/lib/common/string-builder.js: path could not be
found within the project or in these directories:
I believe this is occurring because path
is a node specific library, and it is being used in a non-node context. I haven't validated that this doesn't work in web, but I imagine it wouldn't since path
is also not part of the standard library in web.
This appears to have been introduced in #149
To Reproduce Steps to reproduce the behavior:
- Add axios logger to a react native app
- Run the app and see above error
Expected behavior For it to work
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS
Yep same issue for me with React Native / Expo:
The package at "node_modules/axios-logger/lib/common/string-builder.js" attempted to import the Node standard library module "path".
It failed because the native React runtime does not include the Node standard library.
Reverting to 2.7.1
solves it
Yep same issue for me with React Native / Expo:
The package at "node_modules/axios-logger/lib/common/string-builder.js" attempted to import the Node standard library module "path". It failed because the native React runtime does not include the Node standard library.
Reverting to
2.7.1
solves it
I'm still facing the same error even though reverting to 2.7.1
@vonkanehoffen.
How annoying @bgarcia95 ! FWIW even after getting it working I ended up reverting to just console.log
middleware for my Expo project - kinda useful being able to drill into objects via the Chrome debugger.
It seems like this code might be causing issues. Let's replace it with an alternative solution.
https://github.com/hg-pyun/axios-logger/pull/149/files#diff-24bd0dea6f9270ec272e72c2e2690eb208e7736288be32dbcfe3a74bc0a7877aR5
@bgarcia95 @vonkanehoffen fixed on 2.8.1
version.