Performance is not defined

See original GitHub issue

Hello, I’m getting

ReferenceError: Performance is not defined
     at createClock (node_modules/lolex/src/lolex-src.js:736:36)
     at Object.install (node_modules/lolex/src/lolex-src.js:791:21)
     at Sandbox.exports.useFakeTimers (node_modules/sinon/lib/sinon/util/fake_timers.js:26:21)

with the new release 2.4.1.

├─┬ sinon@4.5.0
│ ├─┬ @sinonjs/formatio@2.0.0
│ │ └── samsam@1.3.0
│ ├── lodash.get@4.4.2
│ ├── lolex@2.4.1

When used lolex@2.3.2 it was working fine.

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
SimenBcommented, May 16, 2018

There is an integration test with jsdom, showing it works: https://github.com/sinonjs/lolex/blob/master/integration-test/lolex-integration-test.js

Might need the runScripts part, I needed it for Date

1reaction
fatso83commented, May 16, 2018

@panzerdp As #181 discusses, we could need some more information on this regarding browsers affected. Could you tell us which browser/environment this bug appears?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: performance is not defined when using ...
I am getting an error ReferenceError: performance is not defined when trying to use performance.now() to measure the execution time of a ...
Read more >
[Node.js] "ReferenceError: performance is not defined" when ...
I'm running into this error when trying to initialize MusicVAE in Node.js; example code: const mm = require('@magenta/music/node/music_vae') ...
Read more >
How to solve the issue that arise while using performance.now ...
This is a very simple technique to measure the performance of a function. This time is not fixed, it may change every time...
Read more >
performance.now() - Web APIs - MDN Web Docs
The performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds.
Read more >
node js performance is not defined - Code Grepper
node js performance is not defined. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On November 3, 2021 Popularity...
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