ReferenceError: Element is not defined
See original GitHub issueI started getting this error in version 1.18.2:
ReferenceError: Element is not defined
at Object.<anonymous> (/Users/spencerelliott/Dev/path/to/common/temp/node_modules/.registry.npmjs.org/react-focus-lock/1.18.2/react@16.8.4/node_modules/react-focus-lock/dist/cjs/Lock.js:195:44)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/spencerelliott/Dev/path/to/common/temp/node_modules/.registry.npmjs.org/react-focus-lock/1.18.2/react@16.8.4/node_modules/react-focus-lock/dist/cjs/index.js:34:36)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
I think it was introduced in this commit: https://github.com/theKashey/react-focus-lock/commit/7bc46f0f81255455238999f56bf001c5c83797ea#diff-757809db6137e7d28cf62c382a00aeadR147
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
`ReferenceError: Element is not defined` when running mocha ...
onsenui seems to be written for a browser enviroment, whilst you're executing it in a nodejs enviroment. Element is a DOM api. nodejs...
Read more >ReferenceError: Element is not defined · Issue #6610 - GitHub
The issue is that rollup removes unused code. It considers adding const Element = typeof Element === "undefined" ? function () {} :...
Read more >ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
ReferenceError : "x" is not defined. The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >React UIKit v3 error - ReferenceError: Element is not defined
Hello, I'm upgrading React UIKit from v2 to v3 and got an error message ReferenceError: Element is not defined.
Read more >ReferenceError: Element is not defined` when running mocha ...
onsenui seems to be written for a browser enviroment, whilst you're executing it in a nodejs enviroment. Element is a DOM api. nodejs...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

🤷♂️all tests are green 🤷♂️
Got it, so my
jsdom/register, I am using for tests, was letting them pass.