Proper way to import lodash? #17917
-
|
I've been using lodash with Nuxt 3 with no problems like this...
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
I think this is an issue with CommonJS vs ModuleJS. Jest is a CommonJS tool and Nuxt v3 is ModuleJS based. |
Beta Was this translation helpful? Give feedback.
-
|
There's a module for lodash if you're interested |
Beta Was this translation helpful? Give feedback.
-
|
Since this topic got ressurected: Proper way of importing Both because slowly dropping support for CJS solutions and also because of |
Beta Was this translation helpful? Give feedback.
I think this is an issue with CommonJS vs ModuleJS. Jest is a CommonJS tool and Nuxt v3 is ModuleJS based.
There is a new testing tool called Vitest, which uses the same build tool as Nuxt v3.
Heres the Migration Guide from Jest