I want to use the new Map.groupBy
function in an NX/Angular/TypeScript project, but this is not working.
I had IDE errors saying that the function is unrecognized.
I've fixed that updating tsconfig.base.json
file to use ESNext:
"lib": ["ESNext", "dom"],
Now my unit tests are not working at runtime due to a similar error:
Map.groupBy is not a function
TypeError: Map.groupBy is not a function
What are the requirements to make it work?
This functionnality only works with node version >= 21.0.0 and I was using a lower version