React JS Page Unresponsive - javascript

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

Related

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

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.

Dojo mysteriously, persistently blanked on page

We use the dojo framework on our websites. A client has called in a panic saying their sales from users of Microsoft Edge have completely dropped off. I've found that in that browser, intermittently, the dojo variable is null after page load. So of course no interaction works for those users, so of course no sales.
But in the course of testing I found this astonishing thing in devtools:
I don't even know how I would do that if I wanted to do it. So I want to track this down but I have no clue what to look for. I might've suspected some weird, recurring setInterval code, but I would not have thought that could get between the two statements on that last console line.
There's a script line just before the </body> tag where I'm able to put a breakpoint. At that point, dojo is set as the framework as expected. So some code that loads after page load is doing it.
(EDIT: I'd be willing to do iterative, brute force breakpoints if I could. But I only have access to Edge via BrowserStack, and trying to set useful breakpoints in minified code is very difficult in Edge's dev tools.)
Does anyone have a suggestion what sort of thing I should look for?
How to debug for this? Is there a client-exposed variable where you can see the functions set to the document's onload, or a way I can put breakpoints in them?
I attempted using a watch() shim in console to watch for the dojo object being changed, but didn't have much luck with that. (but might have done it incorrectly, so if this is an idea, I might need help with proper implementation).
EDIT: There's also this, if this helps make any sense of it. After I delete dojo, setting it works as expected.
Well, I don't know what the specific problem is, but someone has at least given me a way in which this is possible:
window.__defineGetter__('dojo', function(){ return null })
This doesn't exist in the original code, but at least now I see how it's possible at all. The person who gave me this suggests that the code might be trying to get and protect its own copy of dojo, but something about it goes wrong in Edge.

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?

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

doh robot unavailable after running previous instance

I grabbed the latest dojo code to play around with the DOH robot. I have installed two exact copies of the dojo/dijit/dojox/util package: one on the root level of my server and one under /js/.
localhost/dojo
/dijit
/dojox
/util
Then another copy under:
localhost/js/dojo
js/dijit
js/dojox
js/util
When I navigate to http://localhost/util/doh/tests/Robot.html
, the DOH robot initializes fine and everything runs (the mouse moves, tests pass, etc.)
When I try to do the same thing, only in the /js folder, (eg, http://localhost/js/util/doh/tests/Robot.html) I almost always get the error:
Error: doh.robot not available; skipping test.
Sometimes the robot will load up fine and pass all of the tests. Sometimes I will have the Java popup asking permission to use the robot (when this happens, I get the doh.robot unavailable error.)
Any idea what could be causing this, or some tips to keep this from happening?
I have tried the following things (and even tried all combinations of these steps):
clear firefox settings (ctl+shif+del, check all)
f5, ctl+f5
kill the java process
restart the browser
restart the server
restart the computer
tried all different browsers, same effect
recompiled/resigned the DOHRobot.jar
The thing that really irks me is that I have seen it work fine before, so I know that java and plugins are installed correctly.
I can always go back to the top level and run the robot just fine; the problem only happens when I am in the /js/ directory.
Any tips would be great! Thanks
EDIT I think it works now. The problem was that I was recompiling the robot but not signing the JAR correctly. (Check the .bat file when you compile and notice how it looks for the keystore in the directory above you; when I was making the keystore it saved to the default user directory.) Even though I wasn't changing any of the java code, the JAR was still signed incorrectly. Also if anyone does this, one step I forgot to include was to clear the Java cache! I'm not sure how much that matters.
Anyway I think this is solved; it looks like I wasn't exactly describing the problem correctly either.

Categories

Resources