You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.error node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js:29 Error: Uncaught [TypeError: Object.fromEntries is not a function]
I use CRA 3.0, but I tried in a previous version, and did not work either.
I am interested in the reason why this does not work?
Adding this: Object.fromEntries = l => l.reduce((a, [k,v]) => ({...a, [k]: v}), {}) to the test file solves the issue, but I just would like to understand the reason why I need it.
Thanks!
The text was updated successfully, but these errors were encountered:
The reason is that function isn't implemented yet in node. https://kangax.github.io/compat-table/es2016plus/ is a good resource to see the support of newer APIs in different browsers and node versions.
You can either use a polyfill or avoid using the API until it is has better support.
Hi! I have a beginner question.
The following:
Throws this error:
I am interested in the reason why this does not work?
Adding this:
Object.fromEntries = l => l.reduce((a, [k,v]) => ({...a, [k]: v}), {})
to the test file solves the issue, but I just would like to understand the reason why I need it.Thanks!
The text was updated successfully, but these errors were encountered: