Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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';
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading