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.

ReferenceError: Element is not defined

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
theKasheycommented, Mar 11, 2019

🤷‍♂️all tests are green 🤷‍♂️

0reactions
theKasheycommented, Mar 12, 2019

Got it, so my jsdom/register, I am using for tests, was letting them pass.

Read more comments on GitHub >

github_iconTop 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 >

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