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

screen is not defined #1404

Closed
alexlrobertson opened this issue Mar 4, 2019 · 1 comment
Closed

screen is not defined #1404

alexlrobertson opened this issue Mar 4, 2019 · 1 comment
Labels
core Issues in the core code (lib/core) fix Bug fixes

Comments

@alexlrobertson
Copy link

Expectation: axe.run should run without throwing errors

Actual: axe.run throws

ReferenceError: screen is not defined
      at Object.getEnvironmentData (node_modules/axe-core/axe.js:3694:39)
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:3880:35
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:3656:23
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:3549:11
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:5992:13
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:2637:9
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:5992:13
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:5992:13
      at rule.run.Object.assign.result (node_modules/axe-core/axe.js:2581:9)
      at /Users/arobert3/Sites/verso/node_modules/axe-core/axe.js:3110:14
      at Timeout._onTimeout (node_modules/axe-core/axe.js:5992:13)

Motivation: I want to upgrade my version of axe-core


axe-core version: 3.2.0

Browser and Assistive Technology versions

For Tooling issues:
- Node version: 8.13.0
- Platform:  Mac
@WilcoFiers WilcoFiers added fix Bug fixes core Issues in the core code (lib/core) labels Mar 7, 2019
@WilcoFiers
Copy link
Contributor

Thank you for reporting. Looks like the problem is that we're assuming here that window is the global object.

A workaround would be to do the following before running axe. I'll create a fix for this as well.

global.screen = window.screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) fix Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants