Take for example;
IE7 / IE7 Mode- IE8 & IE9 # http://psc.gov/
IE8/IE7 are totally unhelpful: 'Object required line 1'
In IE9- IE7 mode, I get a different, slightly more frustratingly-almost-helpful message:
"Unable to get the value of the property 'offsetHeight': object is null or undefined"
(again at line 1 char 1)
grep-ing for 'offsetHeight' yields around 470 lines of code in various files. Obviously, digging through hundreds of files is not the ideal solution...
How does one go about debugging this? I've tried using Visual Studio, but I cannot get IE to pass the debugging session to Visual Studio while in IE7 mode.
So the question twofold;
1) How do I debug these sorts of errors?
2) How do I pass a debugging session while in IE7 mode to Virtual Studio?
Any other helpful nuggets you'd like to bestow are appreciated (tools, methods, etc.) It'd be cool if this was the first google result for "Object Required line 1" and it actually contained some useful information.
PS: if somebody reputable could create an object-required-line-1 tag or similar, I'll tag this with it.
Related
I have an error in my form editor preventing me from modifying the form.
I know in which control this occurs but no way to find what exactly causes the problem.
I tried setting breakpoints in the InitializeComponents() of the form I try to open but it doesn't stop (I am in debug mode...). I also tried to attach using a second instant of Visual Studio as demonstrated here, but even when setting all debug exception options to "throw", the attached process doesn't stop and indicate anything about call stack nor other useful information...
All I know is that there is a disposed object I'm trying to access, but absolutely no information as to where in code, etc..
What could I possibly do to debug the situation - knowing which control is the cause but absolutely no idea as to which of the 300 lines of code causes the issue...
I am struggling with getting VS2015 intellisense to work for my requirejs based app.
I followed this article http://blogs.msdn.com/b/visualstudio/archive/2015/04/20/using-requirejs-with-visual-studio.aspx plus some assorted tips from various forums.
I have now gotten so far as to actually make VS realise there are script loader calls in my files.
In the output from the Javascript Language Service the first line indicates that require.config.js has been loaded.
However. As soon as I start typing in one of my module files, the output window is filled with lines like this:
File C:\repository\...\invoices.js contains a script loader file reference
(url = ../services/formvalidator.js, type = text/javascript) that will be
ignored because the upper limit (50) of references that can be added via
script loaders has been reached.
...and intellisense just gives me "Intellisense was unable to determine an accurate completion list for this expression" on all referenced modules.
What do I do now? Surely the whole point of using something like requirejs is to split your code up into separate module files. But if some limit is reached, and no intellisense can be loaded, it seems useless...
Can I change this limit?
Or is something else wrong?
Any suggestions on what to try next?
Cheers!
Kim
I’m having problems debugging my program. When I click on the submit button I get the Yahoo’s search engine message: Page not found message that looks like this:
The requested URL http://localhost:000000/MyController/ControllerAction/7?hsimp=yhse-001
cannot be found or is not available. Please check the spelling or try again later.
This does not leave me with any clue as to which line of code or the location of the problem.
In Chrome developer tool I find the line below
Consider using 'dppx' units, as in CSS 'dpi' means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual 'dpi' of a screen. In media query expression: (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) errorhandler?hsimp=yhse-001&hspart=CND&type=A75DB878ECBE148E7B6F_s_g_e&q=http://localhost:000000/Att…:2
Still confused as to how it relates to my problem. Seems to be referencing screen resolution. How can I find the offending line of code in Web Developer 2010 Express?
This isn't caused a bug in your program code, so there is no "offending line".
It's a problem with your server configuration. But why is Yahoo Search coming up for a localhost resource?
That said, localhost:000000 is not valid. Port numbers must be between 1 and 65535 and do not have leading zeros. Where is 000000 coming from?
I'm currently (trying) to develop an app with Worklight Studio 5.0.6 and Dojo (Mobile) 1.8.3. I have a really hard time to to find a proper method for debugging. After waiting 5-10 minutes for the build an deploy-process on the server, an error usually looks like this in the Chrome debugger:
How am I supposed to track down this error in MY source? The whole stack trace consists entirely of Dojo code which generates an absolutely useless error message after 20 abstraction layers.
Seriously, how do you guys handle this in real life? What methods do you use for debugging Dojo-driven apps in the browser?
spyro
For dojo.parse errors, I find it useful to pause the Chrome debugger on all exceptions (the purple icon on your screenshot, should be blue). You usally get more details about the cause of the error, the name of the DOM node being parsed, etc. in the first exception being raised.
Rémi.
Debugging dojo based application should be the same as debugging any javascript application.
Usually I will follow these steps:
add console.log() somewhere in code: this is fast and most of time this is enough.
set breakpoint in debugger: if step 1 is not enough, you can base on error information to set breakpoint before error line, then step in or step out.
comment out recently changes: for some error which is hard to find the error line, for example, parse error in your case, the good way is comment out your recently changes one by one till back to your last working version. Or, return to your last working version, then add code back one by one.
Create a simple application to reproduce the error : if your application is very complicate and it is hard for you to follow above methods, you can try to create a new application which mimics your current application but with simple logics and try to reproduce the error.
Based on experience : Some errors, for example, extra ',' in the end of array which works at chrome and firefox, will report a nonsense error information at IE. Debug these kinds of errors is very difficult, you can base on your experience or do a google search.
Did you provide isDebug: true in your dojoConfig? Also, try to see if the same occurs in other browsers.
Update: I recently discovered that there are issues with Google Chrome and Dojo debugging and I think it has to do with the asynchronous loading of files. As you can see in the provided screenshot of #spyro, the ReferenceError object is blank (which you can notice because of the empty brackets {}). If you want to solve that, reopen the console of Google Chrome, (for example by tapping F12 twice). After reopening the ReferenceError should not be empty anymore and now you can expand that object by using the arrow next to it and get a more detailed message about what failed.
Usually what I do in situations like that is to place a breakpoint inside the error callback (line 3398 in your case) and then look into the error variable ("e").
I am not sure how familiar you are with the Web Inspector, but once you hit the breakpoint open the Web Inspector 'console' and check for the error properties "e.message" and "e.stack" (just type in "e.message " in the console).
Also, during development it is better to avoid Dojo optimization / minification, which greatly improve your debug-ability.
Bottom line is to try to place the breakpoint before the error is thrown.
I am developing a WP7 app.
The app has a pretty large XML Parsing method and a try/catch block around it. When an exception occurs I just get the causing method's name from the exception's stacktrace, but no line numbers.
So it is pretty annoying to debug in a 400+ LoC method.
My guess is that the pdb files are not deployed to the phone at all.
A workaround would be to split large methods into smaller ones and to use more and smaller try/catch blocks.
But is there any way to enable line numbers in Windows Phone 7 Exceptions?
First of all, a 400+ LoC method is a bad practice, I would definitely recommend to split it.
Little trick: if you're using the debugger, just configure it to break on any exception (in Visual Studio, press Control + Alt + e, and check the 'thrown' checkbox in front of "Common Language Runtime Exceptions". Then, when the exception is thrown, the debugger will automatically stop at the exception location.
Now to answer your question, if you don't have line numbers when compiling in debug mode, then there's probably no practical way to get them. You can try injecting the pdb in the xap file, but I don't think it's worth the trouble.