question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tota11y is incompatible with requireJS (via closure compiler)

See original GitHub issue

On line 78 of /plugins/link-text/index.js there is no check to ensure that axs is defined.

let extractedText = axs.properties.findTextAlternatives(
                el, alts);

and I’ve seen this when clicking the Link text test:

Uncaught TypeError: Cannot read property 'properties' of undefined
  (anonymous function) @ tota11y.js:12651
  jQuery.extend.each @ tota11y.js:672
  jQuery.fn.jQuery.each @ tota11y.js:437
  run @ tota11y.js:12636
  activate @ tota11y.js:10118
  handlePluginClick @ tota11y.js:113
  $checkbox.buildElement.onClick @ tota11y.js:10074
  jQuery.event.dispatch @ tota11y.js:4733
  elemData.handle @ tota11y.js:4419

I’m also able to trigger similar errors for rules other than the Headings rule tracing back to a similar problem with axs not being defined in /plugins/shared/audit.js for config = new axs.AuditConfiguration();

I’m still trying to track down additional information as I’m including the script when pages are rendered in the CMS I’m using. I haven’t yet figured out if it is part of the CMS wrapping, or code on the rendered page that could be interfering. It appears that the use of requirejs on a page in the CMS may interfere, as pages without that appear to be working.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jdancommented, Jan 13, 2016

Got an update for you 😃

I went ahead and made a new directory containing require.js, tota11y.min.js, and an index.html file. I also created a simple main.js file which exports an integer.

<html>
<head>
    <title>tota11y + requirejs</title>
</head>
<body>
    <p>Hello, world!</p>
    <script data-main="./main.js" src="./require.js" type="text/javascript"></script>
    <script>
        require(['main'], function(main) {
            require(['tota11y.min.js']);
        });
    </script>
</body>
</html>

Running this I can confirm that axs.properties is undefined. Strange! I went ahead and subbed out tota11y.min.js for axs_testing.js (linked here: https://github.com/GoogleChrome/accessibility-developer-tools/blob/master/dist/js/axs_testing.js) and found the same result.

So, I can confirm that attempting to evaluate Accessibility Developer Tools (axs_testing.js, which tota11y uses under the hood) results in some weird clashing of the word require.

I’ll sync up with the folks from Google and see if they have a solution in mind, hang tight - sorry to keep you waiting.

0reactions
jasondaycommented, Sep 6, 2017

I’m still experiencing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Closure Compiler to concatenate files using requirejs
These files are in-turn dependent on other JS files and I only want the dependent JS files to get concatenated in the final...
Read more >
npm - Snyk
... @jupyterlab/application · @kadira/react-split-pane · @kbsoftware/kb-base-ember-addons · @khanacademy/tota11y · @kolkov/angular-editor · @lcf.vs/css-ui ...
Read more >
edx/edx-platform | Coveralls - Test Coverage History & Statistics
Test code coverage history for edx/edx-platform.
Read more >
JS Party: JavaScript, CSS, Web Development - Changelog
See how other teams are using this awesome feature at about.sourcegraph.com/code-insights ... an automation library for cross-browser end-to-end testing.
Read more >
Experts for js-docs discord - Linknovate
Name Score News GitHub 143.7 11 Google 118.6 8 Netflix 55.3 5
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found