Enterprise: General: Error building locale

Created on 29 Apr 2020  ·  16Comments  ·  Source: infor-design/enterprise

Describe the bug
Including locale in a custom build is giving an error.

To Reproduce
Steps to reproduce the behavior:

  1. Pull master
  2. run npm run build -- --components=locale
  3. see error [!] Error: 'AfZa' is not exported by src\components\locale\cultures\af-za.js, imported by temp\components.js

Expected behavior
Should be able to generate a build that includes locale

Version

  • ids-enterprise: 4.27.x

Platform

  • Windows

Additional context
We've always been building locale as a component on one of our pages.. is that even necessary?

[2] type

Most helpful comment

Thanks guys! Just had our first fully successful build using 4.28.x!

All 16 comments

Actually, we're using locale on more than one page, and I do now see that it is necessary.

I think some would definitely bring locale in with it as needed, wondering if it works without it added explicitly? But probably another we should fix here

cc @EdwardCoyle

@awbuboltz are you using the Locale component API directly in your app? If not, you may not need to build it this way. However if you do use API like Locale.translate() directly in the app this would be necessary.

It's not clear to me why this isn't building but agreed it definitely should. 👍

Yeah, we do use it directly, isRTL(), setting the locale manually, getting the calendar(), things like that.

Hey @EdwardCoyle, I'm still seeing the same AfZa error when running npm run build -- --components=locale, is it working for you?

@awbuboltz I just realized this issue was still in the 4.29.x project. We merged this into 4.28.x and have not pushed everything there to master yet, but we will once Q/A is finished. Once we do that, you should be seeing this resolved in master.

@awbuboltz I tested this on master branch i had actually merged this already to master april 29 So which branch were you testing on or where and is it maybe old?

To test i pulled master...

git checkout master
git pull
npm run clean
npm run build -- --components=locale

I think this should work from my tests either if you use our master branch and test it or if you import 4.28.0-rc.0 on your end it should work in that too?

Hmm.. I'm still seeing Error: 'AfZa' is not exported by src\components\locale\cultures\af-za.js, imported by temp\components.js in 4.28.0-rc.0 as well as master?

Hmm not seeing it..

tmcconechy@usmvtmcconechy master2 % npm run build -- --components=locale

> [email protected] build /Users/tmcconechy/Dev/master2
> npm run clean:dist && node ./scripts/build "--components=locale"


> [email protected] clean:dist /Users/tmcconechy/Dev/master2
> rimraf temp && rimraf dist


=========   IDS Enterprise Builder   =========

Searching files in `src/` for the following terms:
- locale

JS Source Code: 1 files
jQuery Source Code: 0 files
Sass Source Code: 0 files

Running build processes with custom entry points...

Running "copy:custom-test" (copy) task
Copied 4 files

Done.
Running "copy:main" (copy) task
Copied 264 files

Done.
(!) You have passed an unrecognized option
Unknown CLI flag: components. Allowed options: acorn, acornInjectPlugins, amd, assetFileNames, banner, c, cache, chunkFileNames, chunkGroupingSize, compact, config, context, d, dir, dynamicImportFunction, e, entryFileNames, environment, esModule, experimentalCacheExpiry, experimentalOptimizeChunks, exports, extend, external, externalLiveBindings, f, file, footer, format, freeze, g, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, m, manualChunks, moduleContext, n, name, namespaceToStringTag, noConflict, o, onwarn, outro, p, paths, perf, plugin, plugins, preferConst, preserveModules, preserveSymlinks, shimMissingExports, silent, sourcemap, sourcemapExcludeSources, sourcemapFile, stdin, strict, strictDeprecations, treeshake, v, w, watch

temp/index.js → dist/js/sohoxi.js...
created dist/js/sohoxi.js in 2.9s
✓  IDS Build was successfully created in "dist/"
tmcconechy@usmvtmcconechy master2 %

I also tested this on both 4.28.x and master after doing a full removal of node modules, npm install, clean, etc, and wasn't seeing it fail.

@awbuboltz can you try the following and let me know what you find?

Run these in your terminal:

npm run clean
npm run build -- --components=locale --dry-run

When that completes:

  • open the enterprise project folder and find temp/components.js
  • check the number of entries here. A working build should only have an export for Locale and none of the culture files (this was the error that was causing builds to fail before).

npm run build -- --components=locale --dry-run

[email protected] build
npm run clean:dist && node ./scripts/build "--components=locale" "--dry-run"

[email protected] clean:dist
rimraf temp && rimraf dist

========= IDS Enterprise Builder =========

Searching files in src/ for the following terms:

  • locale

JS Source Code: 58 files
jQuery Source Code: 0 files
Sass Source Code: 0 files

✓ Completed dry run! Generated files are available in the "temp/" folder.

// Foundational ====/
export { AfZa } from '../src/components/locale/cultures/af-za';
export { ArEg } from '../src/components/locale/cultures/ar-eg';
export { ArSa } from '../src/components/locale/cultures/ar-sa';
export { BgBg } from '../src/components/locale/cultures/bg-bg';
export { CsCz } from '../src/components/locale/cultures/cs-cz';
export { DaDk } from '../src/components/locale/cultures/da-dk';
export { DeDe } from '../src/components/locale/cultures/de-de';
export { ElGr } from '../src/components/locale/cultures/el-gr';
export { EnAu } from '../src/components/locale/cultures/en-au';
export { EnGb } from '../src/components/locale/cultures/en-gb';
export { EnIn } from '../src/components/locale/cultures/en-in';
export { EnNz } from '../src/components/locale/cultures/en-nz';
export { EnUs } from '../src/components/locale/cultures/en-us';
export { EnZa } from '../src/components/locale/cultures/en-za';
export { Es419 } from '../src/components/locale/cultures/es-419';
export { EsAr } from '../src/components/locale/cultures/es-ar';
export { EsEs } from '../src/components/locale/cultures/es-es';
export { EsMx } from '../src/components/locale/cultures/es-mx';
export { EsUs } from '../src/components/locale/cultures/es-us';
export { EtEe } from '../src/components/locale/cultures/et-ee';
export { FiFi } from '../src/components/locale/cultures/fi-fi';
export { FrCa } from '../src/components/locale/cultures/fr-ca';
export { FrFr } from '../src/components/locale/cultures/fr-fr';
export { HeIl } from '../src/components/locale/cultures/he-il';
export { HiIn } from '../src/components/locale/cultures/hi-in';
export { HrHr } from '../src/components/locale/cultures/hr-hr';
export { HuHu } from '../src/components/locale/cultures/hu-hu';
export { IdId } from '../src/components/locale/cultures/id-id';
export { ItIt } from '../src/components/locale/cultures/it-it';
export { JaJp } from '../src/components/locale/cultures/ja-jp';
export { KoKr } from '../src/components/locale/cultures/ko-kr';
export { LaIt } from '../src/components/locale/cultures/la-it';
export { LtLt } from '../src/components/locale/cultures/lt-lt';
export { LvLv } from '../src/components/locale/cultures/lv-lv';
export { MsBn } from '../src/components/locale/cultures/ms-bn';
export { MsMy } from '../src/components/locale/cultures/ms-my';
export { NbNo } from '../src/components/locale/cultures/nb-no';
export { NlNl } from '../src/components/locale/cultures/nl-nl';
export { NnNo } from '../src/components/locale/cultures/nn-no';
export { NoNo } from '../src/components/locale/cultures/no-no';
export { PlPl } from '../src/components/locale/cultures/pl-pl';
export { PtBr } from '../src/components/locale/cultures/pt-br';
export { PtPt } from '../src/components/locale/cultures/pt-pt';
export { RoRo } from '../src/components/locale/cultures/ro-ro';
export { RuRu } from '../src/components/locale/cultures/ru-ru';
export { SkSk } from '../src/components/locale/cultures/sk-sk';
export { SlSi } from '../src/components/locale/cultures/sl-si';
export { SvSe } from '../src/components/locale/cultures/sv-se';
export { ThTh } from '../src/components/locale/cultures/th-th';
export { TrTr } from '../src/components/locale/cultures/tr-tr';
export { UkUa } from '../src/components/locale/cultures/uk-ua';
export { ViVn } from '../src/components/locale/cultures/vi-vn';
export { ZhCn } from '../src/components/locale/cultures/zh-cn';
export { ZhHans } from '../src/components/locale/cultures/zh-hans';
export { ZhHant } from '../src/components/locale/cultures/zh-hant';
export { ZhTw } from '../src/components/locale/cultures/zh-tw';
export { UmalquraData } from '../src/components/locale/info/umalqura-data';
export { Locale } from '../src/components/locale/locale';

// Mid ====/

// Complex ====/

That doesn't seem right.. I see the same output when running with [email protected] as well.

Seeign similar output using master.

// Foundational ====/
export { AfZa } from '../src/components/locale/cultures/af-za';
export { ArEg } from '../src/components/locale/cultures/ar-eg';
export { ArSa } from '../src/components/locale/cultures/ar-sa';
export { BgBg } from '../src/components/locale/cultures/bg-bg';
export { CsCz } from '../src/components/locale/cultures/cs-cz';
export { DaDk } from '../src/components/locale/cultures/da-dk';
export { DeDe } from '../src/components/locale/cultures/de-de';
export { ElGr } from '../src/components/locale/cultures/el-gr';
export { EnAu } from '../src/components/locale/cultures/en-au';
export { EnGb } from '../src/components/locale/cultures/en-gb';
export { EnIn } from '../src/components/locale/cultures/en-in';
export { EnNz } from '../src/components/locale/cultures/en-nz';
export { EnUs } from '../src/components/locale/cultures/en-us';
export { EnZa } from '../src/components/locale/cultures/en-za';
export { Es419 } from '../src/components/locale/cultures/es-419';
export { EsAr } from '../src/components/locale/cultures/es-ar';
export { EsEs } from '../src/components/locale/cultures/es-es';
export { EsMx } from '../src/components/locale/cultures/es-mx';
export { EsUs } from '../src/components/locale/cultures/es-us';
export { EtEe } from '../src/components/locale/cultures/et-ee';
export { FiFi } from '../src/components/locale/cultures/fi-fi';
export { FrCa } from '../src/components/locale/cultures/fr-ca';
export { FrFr } from '../src/components/locale/cultures/fr-fr';
export { HeIl } from '../src/components/locale/cultures/he-il';
export { HiIn } from '../src/components/locale/cultures/hi-in';
export { HrHr } from '../src/components/locale/cultures/hr-hr';
export { HuHu } from '../src/components/locale/cultures/hu-hu';
export { IdId } from '../src/components/locale/cultures/id-id';
export { ItIt } from '../src/components/locale/cultures/it-it';
export { JaJp } from '../src/components/locale/cultures/ja-jp';
export { KoKr } from '../src/components/locale/cultures/ko-kr';
export { LaIt } from '../src/components/locale/cultures/la-it';
export { LtLt } from '../src/components/locale/cultures/lt-lt';
export { LvLv } from '../src/components/locale/cultures/lv-lv';
export { MsBn } from '../src/components/locale/cultures/ms-bn';
export { MsMy } from '../src/components/locale/cultures/ms-my';
export { NbNo } from '../src/components/locale/cultures/nb-no';
export { NlNl } from '../src/components/locale/cultures/nl-nl';
export { NnNo } from '../src/components/locale/cultures/nn-no';
export { NoNo } from '../src/components/locale/cultures/no-no';
export { PlPl } from '../src/components/locale/cultures/pl-pl';
export { PtBr } from '../src/components/locale/cultures/pt-br';
export { PtPt } from '../src/components/locale/cultures/pt-pt';
export { RoRo } from '../src/components/locale/cultures/ro-ro';
export { RuRu } from '../src/components/locale/cultures/ru-ru';
export { SkSk } from '../src/components/locale/cultures/sk-sk';
export { SlSi } from '../src/components/locale/cultures/sl-si';
export { SvSe } from '../src/components/locale/cultures/sv-se';
export { ThTh } from '../src/components/locale/cultures/th-th';
export { TrTr } from '../src/components/locale/cultures/tr-tr';
export { UkUa } from '../src/components/locale/cultures/uk-ua';
export { ViVn } from '../src/components/locale/cultures/vi-vn';
export { ZhCn } from '../src/components/locale/cultures/zh-cn';
export { ZhHans } from '../src/components/locale/cultures/zh-hans';
export { ZhHant } from '../src/components/locale/cultures/zh-hant';
export { ZhTw } from '../src/components/locale/cultures/zh-tw';
export { UmalquraData } from '../src/components/locale/info/umalqura-data';
export { Locale } from '../src/components/locale/locale';

// Mid ====/

// Complex ====/

After some testing it seems that we've got build errors happening only on Windows. I'll have to make a PR to adjust some code that might only be dealing with Unix-style paths.

Thanks guys! Just had our first fully successful build using 4.28.x!

Was this page helpful?
0 / 5 - 0 ratings