New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Nuxt3] moment.locale not set new locale #6109
Comments
Have the same issue. Any solutions? |
import the locale you want
|
Got error importing locale from dist folder: SyntaxError: Unexpected token 'export' |
For those that are experiencing the SyntaxError: Unexpected token 'export', make sure to add the file extension at the end of import. In my case was
If you still have the same error, go to node_modules/moment/dist/locale and check the extension is mjs or js |
The following helped when using Nuxt 3: import moment from 'moment'
import 'moment/dist/locale/ru.js'
moment.updateLocale('ru', null) |
Describe the bug
moment.locale not set new locale, instead of this it always return 'en'
UPD: It seems in ssr mode it works fine, but on client is not
To Reproduce
https://stackblitz.com/edit/nuxt-starter-fy3grx?file=app.vue
The text was updated successfully, but these errors were encountered: