alexbrazier / react-native-network-logger Goto Github PK
View Code? Open in Web Editor NEWAn HTTP network request monitor for React Native with in-app interface for iOS and Android with no native code
License: MIT License
An HTTP network request monitor for React Native with in-app interface for iOS and Android with no native code
License: MIT License
Feature Request
i want to see console log in release build, is it possible to show console log like Vconsole ?
Feature Request
Add an option to ignore logs from certain hosts
When I try importing your package into my currently existing react-native project I get a problem from the package saying in the import part there is a syntax error with an unexpected token. All I did was yarn add react-native-network-logger then tried running my project again. Thank you for any help! I have attached an image of the error message.
When tapping on a specific request in the list view I am unable to view the details. I receive the following error message:
Error: Text strings must be rendered within a <Text> component.
This is in a fairly new app using RN 0.62.2
Looking at the code in Header.tsx
it seems it's rendering children
into a <Text>
element. Not exactly sure what's in children
but that seems to be where the error occurs.
Platform:
Feature Request
Having the ability to export the full list of logged request to a JSON file stored locally on the device.
I know the project right now doesn't have any dependencies (that's really nice), but the easiest and most practical way to do it would include using a package like react-native-fs
.
Additional context
I've downloaded and used this package and I've verified that it works for HTTP requests but I'm curious as to whether this also captures network requests from other protocols like SIP?
Hi! First of all, awesome work on this library, it is amazing.
Well, I open this issue using the "Other" template because I really don't know if the problem that I found has some workaround.
As you can see in the image below, at this point in code, the library checks if the interceptor is enabled or not, and if it is already enabled, the code just returns:
So after debugging, I just check that the reactotron-react-native library was enabling that by default, just by importing the library, and that was making the Logger skip the setup and because of that do not log any request.
What I did was remove the Reactotron and put it again manually just when I want to debug other things in my application.
So, I was wondering if there's any way to work around this conflict between these two libraries and make them work together.
Thanks!
Hey! I hope you are doing well!
This library only tracks requests that are made by the app, right? For example, if I develop a web with React and I render it in a webview in my RN app, am I able to see the requests made by that web page?
Feature Request
Set a default max number of requests to be stored before removing old ones and add option to configure when starting the logger.
Feature Request
Web browsers have a network logger. The only thing that this library should do is "Nothing"!
When i use this library with react-native-web
,i got this error:
Failed to compile.
/Users/xxx/xxx/xxx/node_modules/react-native/Libraries/Network/XMLHttpRequest.js
Module not found: Can't resolve './RCTNetworking' in '/Users/xxx/xxx/SellerCenterApp/node_modules/react-native/Libraries/Network'
I finally solve this error by DELETE all references of this library when i am building for the web.
Additional context
On the web platform, this library should do nothing, because the browsers have their logging already.
Describe the bug
Expected behavior
Platform:
Additional context
Feature Request
It should be possible to clear all the requests on the monitor screen to make it easier to debug requests from a certain point.
Feature Request
It's possible to log mqtt requests (web sockets)
Thanks
Describe the bug
Network Calls made by Pinch not showing the log.
Platform:
Feature Request
It should be possible to sort requests by most recent at the top or most recent at the bottom depending on the users preference.
Feature Request
When making a request using FormData
the data part of the curl request is empty. It should include the data as a form data object.
Feature Request
Filters should be added to the monitor page to filter by request method (POST
, GET
, PUT
etc.) and by the response status code, e.g. to only show errors.
Feature Request
Add feature to export/copy api request information from the monitor screen so it can be sent to others via email or slack etc.
as title, thanks
I am using Axios for network call and using router-flux
for the navigation.
I have followed all the steps from README
import { startNetworkLogging } from 'react-native-network-logger';
startNetworkLogging();
AppRegistry.registerComponent(appName, () => App);
<Scene
key="networkLogger"
component={() => <NetworkLogger theme={'dark'} />}
back
headerLayoutPreset="center"
renderTitle={() => <PlainTitleBar />}
/>
Actions.networkLogger({
onBack: () => { Actions.pop() }
});
But no request or response was shown. I have tested it using the simulator, also on a real devices with both debug and release variants. Is there any config that I missed? Thanks
Feature Request
I want to filter out the /ping
calls from the server done by NetInfo
but they're in the same host as my main server that I am trying to monitor.
If we say the request has the following text
HEAD https://trajano.net/ping
It would simplify us by having rules that look like
ignoredPatterns: [
/^HEAD https:\/\/trajano.net\/ping$/
]
Additional context
The response type is sometimes returned as a blob, particularly if it is a large response.
Blobs should be loaded and returned in the reponse string.
Feature Request
Make response body section more user friendly. Mobile screen is limited and let say the response is very big, then it could hurt UX when inspecting. We can collapse the JSON value like redux-devtools.
There is also react-native-json-tree which is based on react-json-tree
used by redux-devtools.
Thanks!
Additional context
const getFullRequest = () => {
const processedRequest = {
...request,
response: responseBody ? JSON.parse(responseBody) : undefined,
duration: request.duration,
};
return JSON.stringify(processedRequest, null, 2);
};
Describe the bug
If there is a request that contains FormData in the body, navigating to the details section of that request crashes the app.
Expected behavior
FormData should be parsed correctly and displayed to the user.
Platform:
Additional context
I believe the issue lies in this method that's inside NetworkRequestInfo.ts
:
private stringifyFormat(data: string) {
try {
return JSON.stringify(JSON.parse(data), null, '\t');
} catch (e) {
return data;
}
}
JSON.parse
throws an error, it's caught, then the FormData is passed onto <LargeText>
as a child but since it's an object still, it crashes
Feature Request
Add a search box to the monitor page so that requests can be filtered by URL
Describe the bug
I noticed in the example app that startNetworkLogging
never gets called. I traced this down to the useEffect hook to the UI component that starts it. So if at any time the UI component was rendered when it shouldn't be, then all network traffic in the session would be recorded.
Judging by the readme this is not expected.
Is this a Bug and should this line be deleted?
Expected behavior
Screenshots
Platform:
Additional context
Describe the bug
When only one request is made at a time, it does not show up a pending, and will only be added to the list after it completes.
If more then one API request is created at the same time, then the pending API request will show as pending.
Expected behavior
When only 1 API request is fired, then it should show up in the request list as pending. Once the request is completed the status number and time should be updated.
Screenshots
It was easier for me to post videos on my fork and screenshots
Working as expected: https://github.com/Spencer-Yoder/react-native-network-logger/blob/Git-issue/Two%20Request(Working%20as%20expected).mp4
Defect: https://github.com/Spencer-Yoder/react-native-network-logger/blob/Git-issue/Single%20Request(Defect).mp4
Platform:
Additional context
Checked out master at v1.7.0 and ran the example project
It is easy to recreate it for me, if there is a delay in the request. Using https://postman-echo.com/delay/5
worked for me.
I want to log out all requests made by a website and interact with its data but without an app like this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.