Comments (1)
The error message you are encountering indicates that the function performance.mark is not available or not a function in the environment where the test is running. This issue seems to be related to the upgrade to Node 16, as you suspected, because Node 16 introduced changes to the behavior of the performance object in certain environments.
The error is occurring in the React library (react-dom.development.js), which suggests that the issue might be with the testing setup or the testing library you are using (e.g., Jest or Enzyme) rather than the React version itself.
Here are some steps you can take to troubleshoot and resolve the issue:
Check Testing Dependencies Compatibility: Ensure that all your testing dependencies (Jest, Enzyme, etc.) are compatible with Node 16 and React 16. Sometimes, certain testing libraries might have issues with newer Node versions.
Update Testing Libraries: Make sure you have the latest versions of testing libraries installed. Newer versions often contain bug fixes and compatibility improvements.
Check Jest Configuration: If you are using Jest as your testing framework, check the Jest configuration file (jest.config.js or jest.config.json) to see if there are any specific settings or transforms that might be affecting the behavior of performance.mark.
Check Enzyme Configuration: Similarly, check your Enzyme configuration. Ensure that the Enzyme adapter for React 16 is compatible with the Node 16 environment.
Verify Babel Configuration: The error might also be related to Babel configuration. Ensure that Babel presets and plugins are up to date and compatible with Node 16.
Check Performance Polyfills: Some libraries or polyfills used in your project might affect the behavior of the performance object. Ensure that there are no conflicting polyfills or that they are correctly configured for Node 16.
Review React-Related Code: Double-check the relevant parts of your React code that use the performance.mark function. Make sure there are no issues with how this function is called or any potential side effects.
Debugging: If the issue persists, you can try debugging the test execution with Node 16 and see if you can pinpoint the exact location where the error is occurring.
Temporary Downgrade: As a temporary solution, you might consider downgrading Node back to version 14 or any other version where the tests were passing until the issue with Node 16 is resolved.
Keep in mind that it's challenging to provide an exact solution without access to the complete codebase and the ability to run the tests directly. If none of the above steps help, it's worth checking the issue you've created on the enzyme GitHub repository (enzymejs/enzyme#2599) regularly to see if there are any updates or solutions from the Enzyme team. Additionally, you can also seek help from the React community and other developers who might have encountered similar issues after upgrading to Node 16.
from react.
Related Issues (20)
- Bug: useRef on react-test-renderer wont work HOT 1
- Bug: NOTHING BIG
- Bug: putting promise into JSX will cause hydration issue HOT 11
- Bug: Pressing `enter` on an input to submit the form submits the first button instead of the form itself (With Actions) HOT 5
- [DevTools Bug] Cannot remove node "434" because no matching node was found in the Store. HOT 1
- Bug: 40k modules in npm, fix that. PLEASE!!!!!
- [DevTools Bug]: Recent version broke modal in chrome browser HOT 1
- Bug: Uncaught TypeError: Cannot read properties of null (reading 'useContext') when importing react-router-dom HOT 25
- [DevTools Bug]: Console error on Firefox "moz-extension:*" pages
- [DevTools Bug]: Excessive CPU Usage HOT 4
- Feature: useEffectEvent should be useCallback without dependency array HOT 9
- Bug: Input icon prop is not working HOT 2
- Bug: React Context API Not Updating Correctly with Concurrent Mode HOT 2
- Reading order/sequence is not in understandable manner on Data card. HOT 1
- Feature: Release ReactCurrentDispatcher as a consumable API to be used in conjunction with useExternalSyncStore HOT 2
- Bug: dynamic import component which use useMemo internaly failed HOT 2
- Bug: Add LinkedIn Tab to website HOT 9
- Bug: HTML element <col> cannot be used as a direct descendant of <table> HOT 1
- Bug: Error in the react web page. (Go full-stack with a framework) HOT 17
- [DevTools Bug] Cannot add node "295" because a node with that id is already in the Store. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.