How to correctly use lodash in a nuxt 3 module?

I've tried to import lodash with a few different ways:

  1. import debounce from 'lodash/debounce'
  2. import { debounce } from 'lodash
Both gave me an error, whenever i tried to use that component from my module:
The requested module '/_nuxt/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js?v=74319f89' does not provide an export named 'default'

What's the right way to do that? I'm using module starter repo: https://github.com/nuxt/starter/tree/module
GitHub
Create a new Nuxt project, module, layer or start from a theme with our collection of starters. - GitHub - nuxt/starter at module
Was this page helpful?