Uncaught error syntax error unrecognized expression unsupported pseudo

Error: Syntax error, unrecognized expression: unsupported pseudo: hover #287 Comments Summary When running a11y on the following page; Unexpected Error Error: Syntax error, unrecognized expression: unsupported pseudo: hover and the tool doesn’t run. Expected Behaviour Tool should finish running. Current Behaviour The tool fails with the following console output: Possible Solution Steps to Reproduce […]

Содержание

  1. Error: Syntax error, unrecognized expression: unsupported pseudo: hover #287
  2. Comments
  3. Summary
  4. Expected Behaviour
  5. Current Behaviour
  6. Possible Solution
  7. Steps to Reproduce (for bugs)
  8. Context & Motivation
  9. Your Environment

Error: Syntax error, unrecognized expression: unsupported pseudo: hover #287

Summary

When running a11y on the following page;

Unexpected Error Error: Syntax error, unrecognized expression: unsupported pseudo: hover

and the tool doesn’t run.

Expected Behaviour

Tool should finish running.

Current Behaviour

The tool fails with the following console output:

Possible Solution

Steps to Reproduce (for bugs)

Context & Motivation

Trying to check accessibility of BBC sites.

Your Environment

  • Version used: v2.2.6
  • Operating System and version: Mac OSX 10.11.6 El Capitan
  • Link to your project:

The text was updated successfully, but these errors were encountered:

In your css somewhere do you have:

“: hover” where’s there’s a space between the colon and the word hover?

I wonder if this is a typo tripping things up.

Looks like a duplicate of #275.

No, there’s no typos in the css

Bitesize are also seeing this when running against a11y tests against their site.

Hi @AdamJamesWalters and @murkas , as Chris said this maybe similar to something that has come up before. @oluoluoxenfree said she is happy to help someone work on a solution for this. And Michael offered some advice about using a try-catch in #275 .

Cheers for nudging this @EmmaJP, Michael’s suggestion of a try. catch will probably be the best solution, as it won’t degrade the experience of using a11y, as far as I can tell.

I’ve had a quick look into this, this morning and have struggled to recreate (I guess CSS must have changed since this was initially reported). Can anyone provide a link to a page that still causes this error? Thanks!

@murkas yes I’ve just got a similar error when running bbc-a11y against the following url, could this be related? https://www.bbc.co.uk/news/politics/constituencies/E14000939

Unexpected Error Error: Syntax error, unrecognized expression: [type=»range»]:disabled::-webkit-slider-runnable-track
at Function.Sizzle.error (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:1560:8)
at Sizzle.tokenize (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2216:11)
at Sizzle.compile (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2610:12)
at Sizzle.select (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2700:16)
at Sizzle (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:862:9)
at Function.Sizzle.matchesSelector (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:1523:9)
at Function.jQuery.filter (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2869:22)
at winnow (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2858:16)
at jQuery.fn.init.is (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2908:12)
at getElementFontSizes (/usr/local/lib/node_modules/bbc-a11y/lib/standards/tests/textMustBeStyledWithUnitsThatAreResizableInAllBrowsers.js:43:28)
Unexpected Error Error: Syntax error, unrecognized expression: [type=»range»]:disabled::-webkit-slider-runnable-track
at Function.Sizzle.error (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:1560:8)
at Sizzle.tokenize (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2216:11)
at Sizzle.compile (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2610:12)
at Sizzle.select (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2700:16)
at Sizzle (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:862:9)
at Function.Sizzle.matchesSelector (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:1523:9)
at Function.jQuery.filter (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2869:22)
at winnow (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2858:16)
at jQuery.fn.init.is (/usr/local/lib/node_modules/bbc-a11y/node_modules/jquery/dist/jquery.js:2908:12)
at getElementFontSizes (/usr/local/lib/node_modules/bbc-a11y/lib/standards/tests/textMustBeStyledWithUnitsThatAreResizableInAllBrowsers.js:43:28)

@greenc05 Thanks for sending this on — I’ll investigate and see if I can determine where the error is thrown using this!

Источник

Unexpected Error Error: Syntax error, unrecognized expression: unsupported pseudo: hover

and the tool doesn’t run.

Tool should finish running.

Unexpected Error Error: Syntax error, unrecognized expression: unsupported pseudo: hover
    at Function.Sizzle.error (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:1541:8)
    at PSEUDO (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:1888:13)
    at matcherFromTokens (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2437:44)
    at Sizzle.compile (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2591:13)
    at Sizzle.select (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2677:16)
    at Sizzle (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:845:9)
    at Function.Sizzle.matchesSelector (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:1504:9)
    at Function.jQuery.filter (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2846:22)
    at winnow (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2835:16)
    at jQuery.fn.init.is (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2885:12)
Unexpected Error Error: Syntax error, unrecognized expression: unsupported pseudo: hover
    at Function.Sizzle.error (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:1541:8)
    at PSEUDO (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:1888:13)
    at matcherFromTokens (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2437:44)
    at Sizzle.compile (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2591:13)
    at Sizzle.select (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2677:16)
    at Sizzle (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:845:9)
    at Function.Sizzle.matchesSelector (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:1504:9)
    at Function.jQuery.filter (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2846:22)
    at winnow (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2835:16)
    at jQuery.fn.init.is (/Users/waltea07/workspace/accessibility-checker/node_modules/jquery/dist/jquery.js:2885:12)
0 pages checked, 0 errors found, 0 warnings, 0 standards skipped

Trying to check accessibility of BBC sites.

In #2882175: Accessibility: Close popover when ESC is pressed, code was added which assumes that jQuery UI is loaded. This results in the following error: «Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: focusable» if the sub theme doesn’t use jQuery UI, which is commonly the case for anonymous visitors. Patch to follow.

Tag1 supports the Drupal Project.Tag1 logo

Comments

  • Log in or register to post comments

loopduplicate’s picture

Comment #2

loopduplicate

Location Burning Token, California

CreditAttribution: loopduplicate commented 13 November 2018 at 01:04

Here’s a patch which pulls the anonymous behavior function out into a named function and later checks to see if jquery.ui is available before attempting to use :focusable.

  • Log in or register to post comments

markhalliwell’s picture

Title: Check for jQuery UI before using :focusable » Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: focusable
Status: Needs review » Fixed
File Size
3013236-3.patch 1.49 KB

#2 isn’t really much of a solution since it would work some of the time and just confuse people with unknown «random» behavior.

We can just get away with using :visible instead. It was merely meant as a way to activate jQuery’s «global focus» magic.

  • Log in or register to post comments
  • markcarver committed 26ac6c3 on 8.x-3.x
    Issue #3013236 by markcarver, loopduplicate: Uncaught Error: Syntax...
  • Log in or register to post comments

loopduplicate’s picture

Comment #5

loopduplicate

Location Burning Token, California

CreditAttribution: loopduplicate commented 13 November 2018 at 15:36

Thanks for the commit. I see how my approach was wrong now, whoops. I figured my approach wouldn’t be the one that got accepted but I needed a bandaid last night :)

  • Log in or register to post comments

markhalliwell’s picture

Not sure about the ‘unknown «random» behavior’ you are referring to

jQuery UI can still be loaded on some pages were certain widgets like drag/resize that are commonly used throughout Drupal sites.

This means that some users will be able to close by losing focus on another element and some won’t and the popover would still be visible.

Thus, this can lead to what some users would classify as «random» because they wouldn’t know why it would close on some pages and not others.

  • Log in or register to post comments

loopduplicate’s picture

Comment #7

loopduplicate

Location Burning Token, California

CreditAttribution: loopduplicate commented 13 November 2018 at 15:45

Yeah, sorry Mark. I was tired and read the code wrong the first time. I didn’t realize that you were using the second parameter as delegation. For some reason, my brain was thinking you were using multiple selectors in the first argument. Sigh. Guess that’s what I get for jumping back and forth from front end and back end so much and for taking a couple of months off, pretty much :) Cheers.

  • Log in or register to post comments

markhalliwell’s picture

Heh, no worries. I’m the one who introduced this bug, so… we all make mistakes :D

  • Log in or register to post comments

markhalliwell’s picture

FTR/explanation: the reason #2 appeared to work for you last night is because it essentially removed the entire focus code from play.

  1. +++ b/js/popover.js
    @@ -59,13 +66,7 @@ var Drupal = Drupal || {};
    +        .on('focus.bs.popover', focusBehavior)
    

    Doesn’t actually do anything because there really isn’t a global «focus» event. That’s why the second delegate parameter is needed so it triggers jQuery’s magic (it’s not a widely known or documented feature).

  2. +++ b/js/popover.js
    @@ -81,6 +82,10 @@ var Drupal = Drupal || {};
    +        $document.on(':focusable', focusBehavior);
    

    Doesn’t actually do anything because :focusable isn’t a valid event to bind, or rather… nothing actually triggers an event with that name.

  • Log in or register to post comments

markhalliwell’s picture

  • Log in or register to post comments

ressa’s picture

I just noticed this warning:

Syntax error, unrecognized expression: unsupported pseudo: focusable

Thanks for fixing it! Is there a temporary solution until the patch is included in the official release, or is a fresh release close?

  • Log in or register to post comments

markhalliwell’s picture

Just use the patch until another release is made. I may do another one later this month or perhaps next month… just have to see how it falls.

  • Log in or register to post comments

ressa’s picture

Sure. For others, here is an article on How to apply patches in Drupal 8 with Composer, and the bit for this patch:

        "patches": {
            "drupal/bootstrap": {
                "Fixes Uncaught Error ... unsupported pseudo: focusable": "https://www.drupal.org/files/issues/2018-11-13/3013236-3.patch"
            }
        }
  • Log in or register to post comments

loopduplicate’s picture

Comment #14

loopduplicate

Location Burning Token, California

CreditAttribution: loopduplicate commented 15 November 2018 at 00:00

You can also get the dev version, which already includes the patch.

  • Log in or register to post comments

ressa’s picture

I know @loopduplicate, and thanks for the tip, but I need to use the latest stable release in composer.json.

  • Log in or register to post comments
Status: Fixed » Closed (fixed)

Automatically closed — issue fixed for 2 weeks with no activity.

  • Log in or register to post comments
  • Remove From My Forums
  • Question

  • User-1826049516 posted

    Hi,

    I am doing this:

    $( function() {
    
    	$.expr[':'].exact = $.expr.createPseudo( function( input ) {
    
    		return function( elem ) {
    		
    			return $( elem ).text() === $.trim( input );
    			
    		}
    		
    	} );
    	
    	$.expr[":"].expanded = $.expr.createPseudo( function() {
    	
    		return function( elem ) {
    			
    			return $( elem ).css( "display" ) === "none";
    			
    		}
    		
    	} );
    	
    } );
    
    

    These work fine if they are in $( document ).ready but in pageLoad() I get this in the console:

    Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: expanded

    Are custom selectors not available in pageLoad()? I use UpdatePanels so need them to be!!

    Thanks

Answers

  • User-1826049516 posted

    I’ve binned off pageLoad() and changed to PageRequestManager, which I was already using for other stuff anyway:

    var page;
    
    $( function() {
    
    	page = Sys.WebForms.PageRequestManager.getInstance(); 
    	page.add_beginRequest( beginRequest );
    	page.add_endRequest( endRequest );
    	
    	$.expr[":"].expanded = $.expr.createPseudo( function() {
    	
    		return function( elem ) {
    			
    			return $( elem ).css( "display" ) === "none";
    			
    		}
    		
    	} );
    	
    } );
    
    function endRequest( sender, args ) {
    
    	pageLoadViewState();
    	
    }
    
    function pageLoadViewState( requestType ) {
    
    	count = $.find( ".detailRow:expanded" ).length;
    	// and lots of other code;
    	
    }
    
    $( document ).ready( function() {
    
    	pageLoadViewState();
    	// and lots of other code;
    	
    } );
    • Marked as answer by

      Thursday, October 7, 2021 12:00 AM

User avatar

sudheer

PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

When I’am trying to migrate extensions version from 0.5.0 to 0.7.0 I can see few client side errors in the console as below and some part of the page is not working with this error.

Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: tbl jquery.js.jsf:21

Is it jQuery version changes occured from 0.5.0 to 0.7.0 migration. Ofcourse,Extensions using the same jquery version as of Primefaces. Strange :)


User avatar

Oleg

Expert Member
Posts: 3803
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

06 Jun 2013, 15:09

I see this first time that a PF Ext. team member asks in this sub-forum :-). Normally, they answer questions ;)

I’m pretty sure, the jQuery version was changed. I don’t follow this thing, but from 0.5 to 0.7 was a long way.


User avatar

sudheer

PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

06 Jun 2013, 16:03

Sometimes strange things will happen like the error I got :lol: .I too pretty sure there will be jquery version changes from 0.5 to 0.7.x But not sure why it causes client side errors.


User avatar

sudheer

PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

07 Jun 2013, 11:03

I can see this issue exist from 0.6.0 release onwards.It works perfectly with earlier versions.There is a new component/functionality called pe:escapeSelector added in 0.6.0 version onwards.So we should use this component(few use cases) or escape with \ when we use selectors like forSelector attributes(Applicable for pe:tooltip).

Issues identified:

1.I can rectify the errors by escaping the colon ‘:’ with double backward slash(\).But I can’t make it work with multiple

Worked:

Code: Select all

forSelector="#form\:tbl th .ui-column-filter" 

Not worked:

Code: Select all

 forSelector="#form\:tbl\:tbl1  th .ui-column-filter" 

2. Affected on other components.Chart is not displaying after any ajax call.


User avatar

sudheer

PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

13 Jun 2013, 11:57

It is an issue with the application code but not with extensions code.Topic changed to Solved :)


  • Who is online

    Users browsing this forum: No registered users and 0 guests

Понравилась статья? Поделить с друзьями:
  • Uncaught error syntax error unrecognized expression ajax
  • Uncaught error syntax error unrecognized expression a href
  • Uncaught error reducers may not dispatch actions
  • Uncaught error recaptcha placeholder element must be empty
  • Uncaught error objects are not valid as a react child