Disable red screen and have actual crash in react-native - javascript

I need to get rid of the LogBox screen with the red error while I'm developing React Native in development mode. I should reproduce a real crash (that the app will crash and die), because that red screen is not working for my scenario.
There are several solutions I've tried but they don't work:
I can get a real crash in release mode, yes. But I don't want that because I am working on a very specific scenario based on the crash, so I should be reloading and refreshing code too often. For that, I need to be on development mode.
console.reportErrorsAsExceptions = false;
I tried this code as suggested here, but that does not change anything and I'm still having the red screen.
NativeModules.ExceptionsManager = null;
I also tried this one again suggested here. But that line is causing another error:
Unable to put on NativeModules: Operation unsupported
Disabling JS dev mode, disabling refresh or minifying code do not help either.
I am working on only Android. Therefore, I tried creating a native module and wrote some erroneous code at the Java part, and triggered that on a button click. At the simplest way, this one:
#ReactMethod
public void crash()
{
throw null;
}
But these exceptions are still, caught by the red screen and the are not really crashing the app.
So what I basically need is, simulating a real crash while on development mode. Is there any way to force crash the app in development mode? My react-native version is 0.63.3. Since I am working on only Android, a native solution also works for me. Any help is appreciated, thanks!

You can run your app in release mode with: react-native run-android --variant=release
In this way you can have your real app in a 'development environment'.

Related

Required props undefined in chrome 83

So after installing chrome 83 one of my pages in my app crashes. It says some of my props that's required is undefined. This only happens in chrome. I've tested in IE 11, Edge, Firefox and it works fine in those. It doesn't happen all the time either in chrome. Especially if i restart my localhost it might work a couple of times and then it starts breaking. I've also checked sha1d on master branch couple of weeks back and it also breaks there. This was never an issue before and started just recently. There has been no code changes for weeks related to that page. Any ideas what can cause this in chrome?
Based on what you are saying if problem only started happening recently in chrome, and this could be the failure of the prop-types library, its the library responsible for showing such a warning a required prop is undefined.
To make sure that it is indeed the problem of the prop-types library, you can switch environment to production, as this library should not work in prod. If indeed its the problem of this library you could try the following
Maybe try removing react dev tools and see if problem still happens
clean install of the library
update the library

Angular 7: no compile errors, but blank screen

I've been working on an Angular app for a couple months now, and recently I started seeing a condition where the app compiles without errors, but when it reloads in Chrome there's just a blank screen. Also, no errors in the console. When I look at the markup, I can see the tag for my root component, but nothing else renders. I'm fairly certain I should NOT see the tag for the root component, but rather the rendered HTML, right? So it loads index.html, then craps out without any indication of what the issue could be. I have been attempting to move my components out of app.module and into feature modules to clean things up, but when I reverse those changes I still can't get the app to load. I've tried stopping and restarting the live dev server, but still no joy.
I'd post code here, but there's a ton of code in this app, and I don't know where the problem is. Why would Angular refuse to render without any compile or console errors, or any indication of what I can do to fix this?? If anyone has any idea where I can start to look, I'll be happy to post code.
FYI, I'm using Angular CLI 7.2.3, Angular 7.2.2. I'm developing in Visual Studio Code with the latest updates on a Windows 10 machine. I should also say that this has happened a few times during development, but I was always able to figure out what was causing the problem.
As requested, here is my answer. It's a bit embarrassing, given that I've been doing web development for over 20 years, but I forgot that I had disabled some options in the Chrome debugger settings. So Angular WAS sending errors when I got the blank screens, I just couldn't see those errors because I had disabled them. Once I reset the options to the default for Chrome, I was able to see all of the errors causing the page not to render. I realized this when I loaded the app in IE Edge and was able to see the errors in the console. I figured if IE is showing me the errors, I must have disabled them in Chrome.

Blank screen when running reactjs webapp in browser

I'm using Reactjs to create a browser based web application which interacts with MongoDB. Everything was working fine until I added webpack. Now, everything still seems to be working fine except when I try to run the application I get a blank screen.
I've went through my code and can't see what I've done wrong and after doing some online research I believe the issue could be caused by any number of things.
Are there any logs which could be used to help investigate this? Failing that, is there a recommended way to investigate this?
As #konekoya stated, the Browser developer tools can be used to identify issues. In my case it showed the error that was preventing my browser from loading properly, I was then able to troubleshoot and solve my issue off the back of it.

Android Chrome constantly crashing with my HTML5 website -- How to debug it?

i have built a HTML5 web site (or rather webapp as you wish) and it works fine in Chrome and firefox. I would say the only thing out of the ordinary is, that it uses
Google Closure in some parts (the issue persists in the simplest, non-optimized mode)
HTML5 canvas for 2D drawing
Now I was curious whether it would run on my Galaxy Tab Tablett and indeed it does. I was able to set up the remote debugging facility https://developers.google.com/chrome-developer-tools/docs/remote-debugging?hl=de and debug my code to get rid of a few things that were not working properly. However I notice that android-chrome regulary crashes while I use my app. The console in my desktop browser then complains about websocket being closed (thats why I suspect it really is a problem of the tablet side).
I would like to know what makes my website crash and am a bit flubbergusted that my HTML/js site can crash a browser like chrome so easily. I would have thought that it should be more stable than that.
Now as I would like to have an "entry" point into debugging the issue:
is there a crash log of chrome for android that I can inspect somehow?
can I somehow make it (chrome or android in general) more verbose on error messages?
There are a couple of things that you can do:
chrome://crashes will list the crashes that it has caught when a tab crashes - you might need to turn on crash reporting in the settings. You won't be able to fix it but you will be able to report it us so we can see if it is an issue.
Use logcat and see if there are any specific issues in the tracing output, such as an out of error message.

Trouble with iOS and PhoneGap

Just started trying to adapt my html, css, javascript files to iOS using PhoneGap (I've also tried NimbleKit but the result is the same). I have a web app that I originally wrote for the Blackberry Playbook. The app works fine on the Playbook and in Chrome and Safari. However, when I try and run it through XCode with PhoneGap, the app displays on the simulator but does not seem to properly run the database coding (at least I think that is the problem). I do not get any build errors.
From the documentation, NimbleKit seems to just support its own internal SQLite, but PhoneGap seems to support WebDB, which is what my database is written in.
Finally, the simulator doesn't seem to run some global variables I have (I know, I know, don't use global variables) although that could be because they appear just after my DB initialization at the beginning of my javascript file.
Any thoughts or points in the right direction would be very helpful. Even if it is to some documentation which can help me debug the app in the iOS sim.
Thanks in advance.
Cold your problem be related to this?
http://phonegap.com/2012/04/18/ios-5-1-and-the-embedded-uiwebview-with-cordova/
I was facing a similar problem with PhoneGap and iOS Simulator last week,
all the code i wrote seem to have no problem,
anyway i tried this remote web inspector, and tried to create a database remotely using Safari Javascript Console,
bottom line I found that I was not able to create web database using iPhone Simulator,
looks like you need to deploy your app onto your device to make use of it.
I might be wrong, but that was what I found.

Categories