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

General: Error building locale #3839

Closed
awbuboltz opened this issue Apr 29, 2020 · 16 comments
Closed

General: Error building locale #3839

awbuboltz opened this issue Apr 29, 2020 · 16 comments
Assignees
Labels
type: bug 🐛 [2] Velocity rating (Fibonacci)

Comments

@awbuboltz
Copy link
Contributor

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?

@awbuboltz
Copy link
Contributor Author

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

@tmcconechy tmcconechy added [2] Velocity rating (Fibonacci) type: bug 🐛 labels Apr 29, 2020
@tmcconechy tmcconechy added this to To do in Enterprise 4.29.x (May 2020) Sprint via automation Apr 29, 2020
@tmcconechy
Copy link
Member

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

@EdwardCoyle
Copy link
Contributor

EdwardCoyle commented Apr 29, 2020

@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. 👍

@EdwardCoyle EdwardCoyle self-assigned this Apr 29, 2020
@EdwardCoyle EdwardCoyle moved this from To do to In progress in Enterprise 4.29.x (May 2020) Sprint Apr 29, 2020
@awbuboltz
Copy link
Contributor Author

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

@awbuboltz
Copy link
Contributor Author

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

@EdwardCoyle EdwardCoyle removed this from Pending Review in Enterprise 4.29.x (May 2020) Sprint May 4, 2020
@EdwardCoyle EdwardCoyle added this to To do in Enterprise 4.28.x (April 2020) Sprint via automation May 4, 2020
@EdwardCoyle
Copy link
Contributor

@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.

@tmcconechy
Copy link
Member

@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?

@awbuboltz
Copy link
Contributor Author

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?

@tmcconechy
Copy link
Member

Hmm not seeing it..

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

> ids-enterprise@4.29.0-dev build /Users/tmcconechy/Dev/master2
> npm run clean:dist && node ./scripts/build "--components=locale"


> ids-enterprise@4.29.0-dev 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 %

@EdwardCoyle
Copy link
Contributor

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).

@awbuboltz
Copy link
Contributor Author

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

ids-enterprise@4.29.0-dev build
npm run clean:dist && node ./scripts/build "--components=locale" "--dry-run"

ids-enterprise@4.29.0-dev 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.

@awbuboltz
Copy link
Contributor Author

// 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 ====/

@awbuboltz
Copy link
Contributor Author

awbuboltz commented May 5, 2020

That doesn't seem right.. I see the same output when running with ids-enterprise@4.28.0-rc.0 as well.

@jvang01
Copy link

jvang01 commented May 5, 2020

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 ====/

@EdwardCoyle
Copy link
Contributor

EdwardCoyle commented May 5, 2020

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.

@awbuboltz
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 [2] Velocity rating (Fibonacci)
Projects
No open projects
Development

No branches or pull requests

4 participants