Almost random restarts/crashes on iPhone WebGL/js web app - javascript

I am working on an web app that needs to run both on Android and iPhone.
There are all sort of reasons why such an app would crash.
One of them being memory, others maybe wrong access to URL or even run time errors in js.
My biggest issue now, is that whenever the iPhone crash, it just restarts. It reports no error, no crash report, no log, no nothing.
It makes it extremely difficult to guess what is the reason for the web app to crash.
Is there something I need to enable on iPhone to see the errors?
Maybe some code in js?
Thanks.

It turns out the errors are displayed in a different place than the log.
I assumed errors would appear the same place as the log, in the safari inspector. But You actually need to click the red error sign to see the errors.
The errors I saw in my case is that it was binding a disposed texture and program.
This might be because I Teardown the assets but the mesh is still in the THREE.js scene, so the next time it renders, it's missing those assets.

Related

React JS Page Unresponsive

I am working on a React Js Project. I tested all of the current functionalities and everything worked as expected.
I proceeded to work on some styling aspects before continuing with the functionality and noticed that my webpage wouldn't update. For example, I would just change a background-color or some other style prop to something obnoxious and noticeable to see if it would update. It wouldn't.
I was also unable to do anything with the URL. For example, if I was on http://localhost:3000/messages and I tried to delete the /messages aspect of the url, the page gets stuck loading infinitely.
I also utilize a local token in the local storage, and I suddenly found myself unable to delete it. When I close the window it informs me that the page has become unresponsive. When its in this state also, I am unable to click on anything. I know this to be true because I have a side nav component that works everywhere but once the app freezes like this it doesn't function.
Before continuing it is imperative to note that this error exists on my machine only. It still works on anyone else's machine if they have access to the codebase.
Does anyone have any idea what could be causing this? I don't even know what code to show you because this error seemingly came out of nowhere.
Now whenever I run npm start to start it, it brings me to the local host, but nothing renders at all. No token, no console statements at all, no ability top refresh or type in the URL. I tried downgrading react-scripts to 3.4.4 but that threw a whole slew of other errors.
And before someone suggests that there's an infinite loop somewhere I can promise you there isn't
If anyone even has an idea what could be going on-- something with PIDs or the kernel or the OS or something that would be help, I truly have absolutely no idea what to even look up for help on this and everyone at my office has hit a wall with this

Intermittent "invalid character at 1,1" errors in Visual Studio 2017 project

I have a large project I'm testing locally where, intermittently, with no changes to the code, and with no common events, the site will suddenly display massive numbers of "invalid character" errors in basic js libraries like jquery. If you try to look at said js files in debug in the various browsers, they come up as gibberish as if they were compiled (they aren't)
The site will lose its formatting because of the lost access to various js libraries, and everything will misbehave. Hitting ctrl+F5 will randomly make it better, worse, or have no effect at all.
Rebuilding the site, resetting IIS, and restarting Visual Studio has no standard result. The only thing that is true is that after A Period Of Time, with no changes made or unmade to the code, the issue will clear as mysteriously as it arrived. Looking at the js files return to their un-gibberishy format, and all proceeds as if nothing has occurred.
It's a large project, and there are certainly packages and libraries that have updates which we're not in a position to update right now. It's the intermittent nature of the issue that's the most annoying - it'll happen with no changes made to the code, and fix itself as mysteriously. It's happening for all users, so it doesn't appear to be any one person's issue.
We're not seeing such a thing happen on out test and production servers, only which running and testing locally. It'll happen whether or not the VS debugger is on or not. There's no common trigger that we can find.
Anyone ever heard of something like this?

React-Native app crashes on JS exceptions, gives useless stack info (Android)

I'm trying to get my iOS React-Native app working on Android. One thing that is hindering me in this already difficult process is that JS exceptions not only seem to crash the app, but the error report is also not giving me useful line number info. Instead it gives me the URL to the local packager instance. How do I make it not crash on JS errors, and also give me useful stack info so I can properly debug?
EDIT: Also this error doesn't occur when I build and run the app on iOS. I'm only getting it on Android.
For now I've found a workaround. I put a breakpoint in File.java, where the exception is thrown, and moved up the stack to DevSupportManagerImpl.java where StackTraceHelper.convertJsStackTrace(ReadableArray details) gets called.
ReadableArray can be inspected in the debugger to reveal the actual JS stack information including the real files and line numbers related to the error.

Why do I fail to debug a nodejs app in Intellij IDEA 11?

I have a single process node.js application, which I wish to debug with Intellij IDEA 11 32 bits (node.js is 32 bits too).
So, I place an initial breakpoint and run. The debugger stops at the breakpoint, but then it refuses to do any of the following:
step into
go to another breakpoint
pause execution
When I step into, it seems just to run, without stepping through the code. Once running, it ignores any subsequent breakpoints and does not break when I press the pause button.
This issue drives me crazy.
Any ideas on how should I troubleshoot it?
EDIT
More info. After IDEA breaks on the first breakpoint (the only successful time) I try to inspect the variables and am unable to see any. IDEA is stuck on "Collecting data..." The watch window does not work too.
EDIT2
Justed posted an issue to their bug tracking system - http://youtrack.jetbrains.com/issue/IDEA-112925
I've been noticing that IntelliJ's node.js debugger kinda sucks. It's death by 1000 cuts. I love IntelliJ to death, its such a nice IDE. But for node, the debugger has a million different scenarios where breakpoints don't work properly, and another million where it doesn't properly give you access to the in-scope variable values, and another million where it doesn't step properly...
I'm gonna hafta try looking for another tool..
UPDATE 2014-01-13: I've been using IntelliJ's debugger for a while now (having found no other good tool). It seems some of the problems with it are problems with node or v8 itself. Most of the problems I was having have either actually been solved by newer versions of IntelliJ, or by using this workaround:
1. create a file called proxyDebug.js
2. put the following content in it:
require('path/to/the/script/you/want/to/debug.js')
3. point your debugger to that file
Apparently the node.js debugging hooks go buggy at the entrypoint script, so by creating this proxy entrypoint that we don't care at all about, there won't be any weird bugs caused by that in the scripts you do care about. The bugs this workaround fixed were missed breakpoints, predefined variables (exports, module, process, etc) being inaccessible by the debugger, and one or two other things I can't remember.
Last WebStorm version I tried (7.0.3) actually takes ages in collecting data but eventually works. If it seems stuck to you, try to leave it for a minute

Chrome freezes on my backbone page: how to debug?

The project I'm working on involves a "planning" screen, which is entirely made with backbone.js (the other pages of the app are not).
My issue is that from times to times, chrome freezes and the web view stop responding to any interaction. Sometimes, I can manage to quit chrome itself, but usually the controls does not answer either.
I'm pretty convinced this is related to the js code. It seems to me that when a script takes too much time, or loops indefinitely, Chrome can detect this and interrupt the script. However, since this is not the case, I'm thinking that too many js objects stay in memory.
Whatever the cause is, I would like to know which chrome dev tools can help me here. While I'm not a beginner in js, asides setting breakpoints and calling console.log, I have no idea how to debug JS apps. I'm not opposed to use another browser if the dev tools are more suited.
Thanks a lot for your time !
FTR : This is a rails 3.2.8 app, using mongodb, & Backbone.js 0.9.2. The js code is written in coffeescript. This issue happened on my macbook air 2012 running mountain lion, as well as on the client machine which runs on windows 7. The issue appeared at least on chrome 22 & 23.
Using the Javascript CPU profiler, I was able to find the group of functions that seems to be responsible for the freezing.
I'm still open to any advice/ressource on debugging javascript code.
Make a console.log in the loop and check if its the same point freezing on all chrome versions. There is a limit see Browser Javascript Stack size limit.
Maybe add some code? Because there could be some memory leaks especially with event handlers!
What I would do is the long and weary approach to getting your hands dirty with console.log. --- in this case.
In your case, and THX for the hint by the way (finding the offender with the CPU profiler, I'll try that next time round), I guess the offenders might be some functions "callbacking" themselves .. probably via some sort of event-handling/bubbling/callback-combination.
What happens then usually is that it just doesn't recognize the endless-loop, because the callback-stack is kinda "broken". Therefor it will never throw a browser-error.
If you have any luck, it doesn't kill the browser quick enough to kill the console. I did have that at times, the console killed (remaining silent), the coffeescript files not even loaded in the debugger (I use a JIT-coffee-to-js-translator as in JS-MVC) ... the page frozen or not doing anything ...
So, if indeed you are lucky and the debugger spits out your console.logs you can thereby guess where your unwanted loop is hiding. Just by looking at the repeated order of the output statements.
of course you know you can set breakpoints right? even conditional breakpoints
I'm currently struggling a bit untangling a similar sounding loop - i guess in case of emergency some alert() calls in your code would at least slow the loop down
or maybe some wait calls (bad idea)
my loop is running so fast I loose my console log!

Categories

Resources