How to use _.groupby() and import _ using lodash-es

I recently used
import { keyBy } from 'lodash-es';
in my code.Similarly I also want to import _ for using _.groupby() in lodash.

I am confused on how to use _.groupby() using lodash-es.

I tried using

import { _ } from 'lodash-es';

Here is my output:

Uncaught SyntaxError: The requested module ‘/node_modules/.vite/deps/lodash-es.js?v=afbadbd5’ does not provide an export named ‘_’

Can anyone help me out?

>Solution :

you can try like below:

import * as _  from 'lodash-es';

Leave a Reply