Skip to content
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

Error: MomentLocalesPlugin: Moment.js doesn't include a locale you specified: ua. Check the plugins localesToKeep option #8012

Closed
1 task done
javadev opened this issue Jul 23, 2018 · 4 comments · Fixed by #8023
Milestone

Comments

@javadev
Copy link

javadev commented Jul 23, 2018

Overview of the issue

I generated jhipster 5.1.0 + react application and can not build it on my pc.

\node_modules\webpack-cli\bin\cli.js:244
[ERROR]                                 throw err;
[ERROR]                                 ^
[ERROR]
[ERROR] Error: MomentLocalesPlugin: Moment.js doesnв??t include a locale you specified: ua. Check the pluginв??s `locale
sToKeep` option.
[ERROR] You can see the full list of locales that Moment.js includes in node_modules/moment/locale/
[ERROR]     at normalizeLocalesToKeep (C:\Users\user\Documents\project java\jobsviewer\node_modules\moment-local
es-webpack-plugin\index.js:67:15)
[ERROR]     at checkOptions (C:\Users\user\Documents\project java\jobsviewer\node_modules\moment-locales-webpack
-plugin\index.js:31:25)
[
Motivation for or Use Case

I think it happened because of my locale ua.

Reproduce the error

Generate jhipster 5.1.0 + react application. Setup locale ua. Try to build war file.

Related issues

moment/moment#2979

Suggest a Fix

Add somme dependency to javascript modules.

JHipster Version(s)

5.1.0

JHipster configuration

{
"generator-jhipster": {
"applicationType": "monolith",
"gitCompany": "",
"baseName": "jobsviewer",
"packageName": "io.github.jhipster.application",
"packageFolder": "io/github/jhipster/application",
"serverPort": 8080,
"serviceDiscoveryType": false,
"authenticationType": "jwt",
"uaaBaseName": "../uaa",
"cacheProvider": "hazelcast",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": "elasticsearch",
"enableSwaggerCodegen": false,
"messageBroker": false,
"buildTool": "maven",
"useSass": true,
"clientPackageManager": "yarn",
"testFrameworks": [
"gatling"
],
"enableTranslation": true,
"nativeLanguage": "ru",
"languages": [
"ua",
"ru"
],
"clientFramework": "react",
"jhiPrefix": "jhi"
},
"git-provider": "GitLab",
"git-company": "javadev",
"repository-name": "jobsviewer"
}

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Windows 10 64 bit.

  • Checking this box is mandatory (this is just to show you read everything)
@javadev javadev changed the title Error: MomentLocalesPlugin: Moment.js doesnв??t include a locale you specified: ua. Check the pluginв??s locale sToKeep option. Error: MomentLocalesPlugin: Moment.js doesnв??t include a locale you specified: ua. Check the pluginв??s localesToKeep option. Jul 23, 2018
@javadev
Copy link
Author

javadev commented Jul 23, 2018

I solved this issue.

screenshot_54

@javadev javadev closed this as completed Jul 23, 2018
@javadev javadev reopened this Jul 23, 2018
@PierreBesson PierreBesson changed the title Error: MomentLocalesPlugin: Moment.js doesnв??t include a locale you specified: ua. Check the pluginв??s localesToKeep option. Error: MomentLocalesPlugin: Moment.js doesn't include a locale you specified: ua. Check the plugins localesToKeep option Jul 24, 2018
@PierreBesson
Copy link
Contributor

@javadev Could you submit a PR to fix this, so that other Ukrainian users won't have the bug. Maybe we can patch this method:

updateLanguagesInMomentWebpackNgx(languages) {

Or maybe the UA locale should be renamed UK ?

@javadev
Copy link
Author

javadev commented Jul 24, 2018

@PierreBesson I found this bug only for React not for Angular.

@pascalgrimaud
Copy link
Member

I confirm the issue.

Currently, we don't have the issue with Angular because the dependency moment-locales-webpack-plugin is different between Angular and React

For Angular:

  • moment-locales-webpack-plugin: 1.0.5

For React:

  • moment-locales-webpack-plugin: 1.0.7

Downgrading the moment-locales-webpack-plugin dependency in React to use the version 1.0.5 works.

pascalgrimaud added a commit to pascalgrimaud/generator-jhipster that referenced this issue Jul 26, 2018
- downgrade moment-locales-webpack-plugin to 1.0.5
- be consistent with Angular
- fix jhipster#8012
@jdubois jdubois added this to the 5.2.0 milestone Aug 13, 2018
deepu105 added a commit to deepu105/generator-jhipster that referenced this issue Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants