Skip to content
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

V2.8.0 Introduces incompatibilities with web and react native #151

Closed
gvanderclay opened this issue Apr 2, 2024 · 5 comments · Fixed by #152
Closed

V2.8.0 Introduces incompatibilities with web and react native #151

gvanderclay opened this issue Apr 2, 2024 · 5 comments · Fixed by #152
Labels
bug Something isn't working

Comments

@gvanderclay
Copy link

gvanderclay commented Apr 2, 2024

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:

  1. Add axios logger to a react native app
  2. 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
@vonkanehoffen
Copy link

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

@bgarcia95
Copy link

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.

@vonkanehoffen
Copy link

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.

@hg-pyun hg-pyun added the bug Something isn't working label May 29, 2024
@hg-pyun
Copy link
Owner

hg-pyun commented May 29, 2024

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

@hg-pyun
Copy link
Owner

hg-pyun commented May 29, 2024

@bgarcia95 @vonkanehoffen fixed on 2.8.1 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants