Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit error: Required Accessibility gatherer encountered an error when using almond.js #2505

Closed
karl-sjogren opened this issue Jun 15, 2017 · 9 comments · Fixed by #3500
Closed
Assignees
Labels

Comments

@karl-sjogren
Copy link

We are using https://github.com/requirejs/almond in our builds instead of the whole requirejs package and this seems to break lighthouse accessibility tests. I've tried it both via the node package and via the Audit tab in Chrome Developer Tools.

lighthouse https://bibliotek.jonkoping.se/

The result is a 0 score for accessibility and all tests have failed with the below message:

Audit error: Required Accessibility gatherer encountered an error: See almond README: incorrect module build, no module name

Almond has 30 000 downloads the last week on npm and is used in lots of places around the web so a solution or at least a workaround that we can use would be great!

@patrickhulce
Copy link
Collaborator

patrickhulce commented Jun 15, 2017

This seems to be an issue with axe-core interacting with your site. Would you mind filing this issue upstream?

I get this stack trace when just trying to run axe on your site without Lighthouse

Uncaught Error: See almond README: incorrect module build, no module name
    at define (vendor-9f0474e5e4.js.br:1)
    at axeFunction (axe.js:24)
    at axe.js:8472

It seems their UMD handling might have to be updated

  if (typeof define === 'function' && define.amd) {
    define([], function() { // axe.js:24
      'use strict';
      return axe;
    });
  }

@ebidel
Copy link
Contributor

ebidel commented Jun 16, 2017

@mjpuser can you post the URL of your site?

@ebidel
Copy link
Contributor

ebidel commented Jun 16, 2017

aweber.com

@karl-sjogren
Copy link
Author

Sorry for the late feedback here but it's easy to forget stuff after a few weeks of vacation.

The thing is that it works fine with their own Developer Tools plugin so I feel that it might be up to how you invoke it. I've solved this on my end using an IIFE around my code anyway so if anyone run into this on their own site then this is a possible workaround.

@paulirish
Copy link
Member

Ok. closing this for now as it's resolved in your case.

If someone else runs into this we'll have to investigate if this is a bug with AXE's UMD or how we're running it.

@shellbryson
Copy link

First time looking at the new auditing on a reasonably sized project and seeing the issue above. Uses RequireJS, but the dev tools appear to choke:

screen shot 2017-08-30 at 15 11 49

@shellbryson
Copy link

@patrickhulce patrickhulce reopened this Aug 30, 2017
@patrickhulce
Copy link
Collaborator

If it works with axe's extension, it's likely because they're running it inside a content script that won't be affected by the globals of the page. Migrating our page evaluations to createIsolatedWorld should fix this for us.

@paulirish
Copy link
Member

in that case, This is blocked by #2505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants