TypeError while initializing in Node 19
See original GitHub issue- FakeTimers version :
9.1.2
- Environment :
node:19.0-alpine@sha256:48e43334c84762aa05c18dac37ec5ca396e9d55c5cb053f15cd4edbfe89a0914
(not reproducible innode: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:
- Created a year ago
- Comments:5 (3 by maintainers)
Top 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 >
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
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-R96Would love for it to be a fix here though, so I can revert that PR and bump the dep 🙂
@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.