travix-international / l10ns Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tinganho/l10ns
Internationalization workflow and formatting
Home Page: http://l10ns.org
License: MIT License
This project forked from tinganho/l10ns
Internationalization workflow and formatting
Home Page: http://l10ns.org
License: MIT License
Labels cannot compile when the value with template is invalid and is processed by handlebars.
When some of the value is invalid the node process cannot compile that label and exit with log:
<--- Last few GCs --->
[22286:0x223aeb0] 25933 ms: Mark-sweep 1290.6 (1367.9) -> 1290.5 (1349.9) MB, 992.4 / 0.0 ms allocation failure GC in old space requested
[22286:0x223aeb0] 26930 ms: Mark-sweep 1290.5 (1349.9) -> 1290.5 (1312.9) MB, 996.9 / 0.0 ms last resort GC in old space requested
[22286:0x223aeb0] 27856 ms: Mark-sweep 1290.5 (1312.9) -> 1290.5 (1312.9) MB, 925.5 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x1c951ea5749 <JSObject>
1: push(this=0x11296b1b5669 <JSArray[33426304]>)
2: parse [/home/umiranchuk/Projects/project/node_modules/l10ns/libraries/MessageFormat/index.js:~194] [pc=0x2068abd1edfd](this=0xa8ec8e84281 <MessageFormat map = 0x11ef615694b1>,message=0x1e7f57242a1 <String[18]: date} at {time}hrs>)
3: /* anonymous */ [/home/umiranchuk/Projects/projct/node_modules/l10ns/plugins/han...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x11df13c [node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::factory::NewUninitializedFixedArray(int) [node]
6: 0xde93bf [node]
7: 0xdfd2e5 [node]
8: v8::internal::JSObject::AddDataElement(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow) [node]
9: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [node]
10: v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) [node]
11: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0x2068abb842fd
Aborted (core dumped)
The issue is in json file with label that has the key 'value'. In that key is stored something wrong like:
date} at {time}hrs
but should be {date} at {time}hrs
Might be it is a good idea to validate json file before parsing it and processing
Example of wrong json:
{
"id": "hotel.checkOutDate",
"key": "hotel.checkOutDate",
"value": "date} at {time}hrs"
}
Repo to reproduce the hanging of 10ns. It does not provide the same error, but demonstrates the problem:
https://github.com/ilabacheuski/l10ns-memory-leak
git clone https://github.com/ilabacheuski/l10ns-memory-leak.git
cd l10ns-memory-leak
npm i -g l10ns
echo ">>> After this step the process will hang on"
l10ns compile
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.