Cannot debug script in html file, as debugger shows wrong line number

I have an html file with a head section containing a couple of css links, some inline styling in a "<style" element, some code references in "<script src=" elements, and finally some inline script in a "<script>" element.

I cannot debug the inline code, because WebStorm thinks the first line of script is on line 1 of the html file (instead of line 134, where it really is).

Is there anything I can do about this, short of putting the code in a separate js file?

6 comments

What WebStorm version do you use? http://youtrack.jetbrains.com/issue/WEB-10379 is partially fixed in WebStorm 8 by using our own script preprocessor instead of Chrome one (that uses absolute addressing, so for embedded javascript the returned address may be larger than the overall script length)
But some problems still persist due to another Chrome issue - https://code.google.com/p/chromium/issues/detail?id=304150. See http://youtrack.jetbrains.com/issue/WEB-6659

0

Currently on 7. Will upgrade to 8 to see what happens...

0

Yes, that's a lot better, thanks.

It still seems to report the wrong line number if there is an error, but breakpoints are now fine.

BTW, is there any reason why Help|Check for updates said I had the latest version (when I was on WebStorm 7)?

Regards,

Nikki

0

Works fine for me - I'm notified about WebStorm 8.0.3 release when  checking for updates if the channel is set to "New Major Version  Releases". You must have chosen to ignore updates once, or something  else had happened. Please try removing \options\other.xml from  ~/.WebStorm7/config, start WebStorm and check for updates
But note that there is no automatic (patch) update between major  versions, updates are supported for minor subsequent releases (like  5.0.1->5.0.2) only. So there is no way to auto-update WebStorm 7 to version 8

0

Thanks very much.

As I am now on 8, I guess this advice no longer applies?

If it does, can you explain what to change in the file to enable updates, rather than deleting it and losing other carefully crafted settings (e.g. recent projects)? [Good thing I took a backup before deleting it!]

Regards,

Nikki

0

>As I am now on 8, I guess this advice no longer applies?

Right. You are using the latest version, no need to update it. When a new one is available, you will be prompted to update

0

Please sign in to leave a comment.