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.

TypeError while initializing in Node 19

See original GitHub issue
  • FakeTimers version : 9.1.2
  • Environment : node:19.0-alpine@sha256:48e43334c84762aa05c18dac37ec5ca396e9d55c5cb053f15cd4edbfe89a0914 (not reproducible in node:18.11-alpine)
  • Example URL : N/A
  • Other libraries you are using: @jest/fake-timers

What did you expect to happen? The code below to execute without throwing an exception.

What actually happens An exception is thrown:

TypeError: Cannot assign to read only property 'performance' of object '[object global]

at hijackMethod (node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:946:32)
at Object.install (node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1733:17)

How to reproduce Run the following:

var FakeTimers = require("@sinonjs/fake-timers");

var clock = FakeTimers.install();

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SimenBcommented, Oct 22, 2022

I was unable to reproduce it here in @sinonjs/fake-timers, so I ended up hacking around it in Jest: https://github.com/facebook/jest/pull/13467/files#diff-7e6b39bebf54c704e027085672211430b8241b080e103d997757bcea915d2041R95-R96

Would love for it to be a fix here though, so I can revert that PR and bump the dep 🙂

0reactions
jonathanschoellercommented, Nov 13, 2022

@SimenB I can’t seem to reproduce the issue now either. I must have had some other environment details I didn’t record. Happy to close this off. Thanks for having a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initialization of this module fails with TypeError #7 - GitHub
I've placed the require('@electron/remote/main').initialize() statement at the the start of the application code (typescript file) and also ...
Read more >
Cannot read properties of undefined (reading 'transformFile ...
Ran into the same issue with Node.js 17.0.0. To solve it, I downgraded to version 14.18.1, deleted node_modules and reinstalled.
Read more >
Errors | Node.js v19.3.0 Documentation
AssertionError s are a special class of error that can be triggered when Node.js detects an exceptional logic violation that should never occur....
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an undefined...
Read more >
Firebase JavaScript SDK Release Notes - Google
Updated firebase/[product] entry point bundles to conform to Node.js ES ... Fixed errors that occurred during initialization of the Authentication SDK when ......
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