strongloop / strong-globalize

strong-globalize is built on Unicode CLDR and jquery/globalize and implements automatic extraction of strings from JS source code and HTML templates, lint the string resource, machine-translate them in seconds. In runtime, it loads locale and string resource into memory and provides a hook to persistent logging.
Other
25 stars 16 forks source link

{ AssertionError [ERR_ASSERTION]: Not supported: en - fixing strong-soap #215 on zeit/pkg builded executable #142

Closed reajuria closed 4 years ago

reajuria commented 5 years ago

Description/Steps to reproduce

Watch the exception

{ AssertionError [ERR_ASSERTION]: Not supported: en at loadGlobalize (C:\snapshot\project-x\node_modules\strong-globalize\lib\globalize.js:408:5) at Object.setDefaultLanguage (C:\snapshot\project-x\node_modules\strong-globalize\lib\globalize.js:66:5) at Function.SetRootDir (C:\snapshot\project-x\node_modules\strong-globalize\lib\strong-globalize.js:64:23) at Object. (C:\snapshot\project-x\node_modules\strong-soap\src\globalize.js:6:4) at Module._compile (internal/modules/cjs/loader.js:700:30) at Module._compile (pkg/prelude/bootstrap.js:1261:32) at Object.Module._extensions..js (internal/modules/cjs/loader.js:711:10) at Module.load (internal/modules/cjs/loader.js:610:32) at tryModuleLoad (internal/modules/cjs/loader.js:549:12) at Function.Module._load (internal/modules/cjs/loader.js:541:3) at Module.require (internal/modules/cjs/loader.js:648:17) at Module.require (pkg/prelude/bootstrap.js:1159:31) at require (internal/modules/cjs/helpers.js:20:18) at Object. (C:\snapshot\project-x\node_modules\strong-soap\src\security\WSSecurityCert.js:3:9) at Module._compile (internal/modules/cjs/loader.js:700:30) at Module._compile (pkg/prelude/bootstrap.js:1261:32) generatedMessage: false, name: 'AssertionError [ERR_ASSERTION]', code: 'ERR_ASSERTION', actual: false, expected: true, operator: '==' } pkg/prelude/bootstrap.js:1178 throw error; ^

AssertionError [ERR_ASSERTION]: Not supported: en at loadGlobalize (C:\snapshot\project-x\node_modules\strong-globalize\lib\globalize.js:408:5) at Object.setDefaultLanguage (C:\snapshot\project-x\node_modules\strong-globalize\lib\globalize.js:66:5) at Function.SetRootDir (C:\snapshot\project-x\node_modules\strong-globalize\lib\strong-globalize.js:64:23) at Object. (C:\snapshot\project-x\node_modules\strong-soap\src\globalize.js:6:4) at Module._compile (internal/modules/cjs/loader.js:700:30) at Module._compile (pkg/prelude/bootstrap.js:1261:32) at Object.Module._extensions..js (internal/modules/cjs/loader.js:711:10) at Module.load (internal/modules/cjs/loader.js:610:32) at tryModuleLoad (internal/modules/cjs/loader.js:549:12) at Function.Module._load (internal/modules/cjs/loader.js:541:3) at Module.require (internal/modules/cjs/loader.js:648:17) at Module.require (pkg/prelude/bootstrap.js:1159:31) at require (internal/modules/cjs/helpers.js:20:18) at Object. (C:\snapshot\project-x\node_modules\strong-soap\src\security\ClientSSLSecurity.js:3:9) at Module._compile (internal/modules/cjs/loader.js:700:30) at Module._compile (pkg/prelude/bootstrap.js:1261:32)

Expected result

Execution without issues

Additional information

Related to #215 strong-soap

raymondfeng commented 5 years ago

Based on https://docs.npmjs.com/files/package.json#files:

Omitting the field will make it default to ["*"], which means it will include all files.

So zeit/pkg does not have the same convention as npm?

Retrojb commented 4 years ago

This article provided little information on what this error is or what could be a possible solution. This error has halted development for myself. I am not asking for the answer just some more details regarding the issue. Thanks

reajuria commented 4 years ago

zeit/pkg is a bundler to build a single executable without sources from a nodejs package/project. I had a project which depends on strong-globalize.

When strong-globalize package was included in the execution fails (zeit/pkg runs fine, but execution of bundled file will generate the exception described previously), I found that zeit/pkg won't include strong-globalize runtime files during compilation due to files property/field on package.json is missing.

karanssj4 commented 4 years ago

add "node_modules/**/strong-globalize/cldr/*.json" to asests when using zeit/pkg to resolve this issue