nuxt-community / date-fns-module

Modern JavaScript date utility library - date-fns for Nuxt.js
MIT License
78 stars 8 forks source link

Cannot read property 'map' of null #44

Closed gilles6 closed 4 years ago

gilles6 commented 4 years ago

After installing and configuring date-fns module as per the documentation, I'm getting the following error:

TypeError: Cannot read property 'map' of null
    at Module.format

How can I fix it ?

ricardogobbosouza commented 4 years ago

Hi @gilles6 Can you share part of your configuration?

4Kazelot commented 4 years ago

@gilles6 I had the same error. Your config cannot be empty. It should look like this:

dateFns: {
        locales: ['es', 'ru', 'pt-BR'],
        defaultLocale: 'en-US',
        format: 'yyyy-MM-dd'
    },