Nuxt Build Error: commonjs--resolver missing specifier in date-fns package

Hi, I am trying to use "date-fns" in my project but I get the following error:

Nuxt Build Error: [commonjs--resolver] Missing "./format/index.js" specifier in "date-fns" package


I use it like:
import { format } from 'date-fns'


Nuxt is latest version and date-fns also. What could be causing this?
Was this page helpful?