nuxt-community / moment-module

Efficient Moment.js integration for Nuxt
MIT License
195 stars 12 forks source link

Module not found: Error: Can't resolve './locale' in '...node_modules/moment/src/lib/locale' #63

Closed seth100 closed 4 years ago

seth100 commented 4 years ago

Hi,

I have never had that warning before, but at some point (I am not sure which package of the ones I am using was updated) I started to get this error:

WARN  in ./node_modules/moment/src/lib/locale/locales.js

Module not found: Error: Can't resolve './locale' in '...node_modules/moment/src/lib/locale'

The only moment locale code I use is:

methods: {
     formatDate(date) {
        return this.$moment(date).locale('fr').format('DD MMMM YYYY');
      }
}

Any help on that please? Thanks

arnauddsj commented 4 years ago

Same problem here, even if don't use the local config

    moment: {
        locales: ["fr"]
    },

I'm still getting

 WARN  in ./node_modules/moment/src/lib/locale/locales.js                                                                                                            friendly-errors 23:24:24

Module not found: Error: Can't resolve './locale' in '***/node_modules/moment/src/lib/locale'

I'm not even calling locale in my code:

{{ $moment(date).format("DD MMMM YYYY") }}

I've just installed the module so can't relate to past experience.

snarcraft commented 4 years ago

moment 2.24.0 seems to work fine

iamgp commented 4 years ago

I also get this, using 1.6.0, without even setting a locale, also with moment 2.24.0.

ricardogobbosouza commented 4 years ago

Problem on moment v2.25 https://github.com/moment/moment/issues/5501 https://github.com/moment/moment/issues/5500

josepuma commented 4 years ago

Same here, getting the same error.

ricardogobbosouza commented 4 years ago

Resolve on v1.6.1