'Aw, Snap!' Error when inspecting element in Chrome

后端 未结 2 872
陌清茗
陌清茗 2021-02-08 00:04

Whenever I inspect any element that\'s part of my navigation menu, OR inspect element and then browse to a navigation menu I get the \'Aw, Snap\' error in Google Chrome. I figur

相关标签:
2条回答
  • 2021-02-08 00:38

    The problem appears to be an issue with your style.css file. In that file, you have:

    /*::selection {
        background: #666; /* Safari */
        color: #FFF;
    }
    
    ::-moz-selection {
        background: #666; /* Firefox */
        color: #FFF;
    }*/
    

    What's happening is you have a comment /* Safari */ within a broader comment around the entire snippet above, which is closing the broader comment prematurely and causing a parse error for the CSS. Google Chrome is choking on the malformed CSS file, which is causing the "Aw, snap!" error to occur when inspecting elements.

    Removing the /* Safari */ comment won't fix that problem, as the /* Firefox */ below it causes the same issue.

    EDIT: While that did fix a minor issue with the CSS, it wasn't the whole solution. In light of thakis' answer below, fixing the following style does prevent the crashing when inspecting elements:

    #navigation-menu-container{
      border-image:  url(images/shadow-border.png) 10 stretch;
    }
    

    Compare this fiddle, which is a copy/paste of the site code in question (all head tags and relevant html markup), with the corrected fiddle, in which the style.css markup has been imported into the fiddle and the #navigation-menu-container rule has been changed to the above code, and you'll see that the fiddle page doesn't crash.

    0 讨论(0)
  • 2021-02-08 00:42

    When chrome crashes, please file a bug at http://new.crbug.com so that the chrome developers can fix the problem. (I've filed http://crbug.com/141139 for this issue for you). Ideally, try making a copy of your site and keep removing things from the copy until you have a small test case that still reproduces the problem. Then attach that to the bug.

    Edit: Looks like this bit from your style.css causes it:

    #navigation-menu-container{
      border-image:  url(images/shadow-border.png) stretch 10;
    }
    

    border-image needs its numbers in front of stretch (see e.g. http://css-tricks.com/understanding-border-image/), and Chrome gets confused by that not being the case. Moving the 10 in front of stretch fixes the crash (but the crash is still a chrome bug of course).

    0 讨论(0)
提交回复
热议问题