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

Readme example fail #813

Closed
ButuzGOL opened this issue Mar 21, 2018 · 6 comments
Closed

Readme example fail #813

ButuzGOL opened this issue Mar 21, 2018 · 6 comments

Comments

@ButuzGOL
Copy link

ButuzGOL commented Mar 21, 2018

I wanted to test readme example but got issue

npm install globalize cldr-data iana-tz-data
var Globalize = require( "globalize" );
Globalize.load( require( "cldr-data" ).entireSupplemental() );
Globalize.load( require( "cldr-data" ).entireMainFor( "en", "es" ) );
Globalize.loadTimeZone( require( "iana-tz-data" ) );

Globalize("en").formatDate(new Date());
// > "11/27/2015"

Globalize("es").formatDate(new Date());
// > "27/11/2015"

<--- Last few GCs --->

[97121:0x102800600] 219576 ms: Mark-sweep 1406.0 (1517.3) -> 1406.0 (1517.3) MB, 3371.5 / 0.0 ms allocation failure GC in old space requested
[97121:0x102800600] 222245 ms: Mark-sweep 1406.0 (1517.3) -> 1406.0 (1497.8) MB, 2668.6 / 0.0 ms last resort GC in old space requested
[97121:0x102800600] 225459 ms: Mark-sweep 1406.0 (1497.8) -> 1405.9 (1497.8) MB, 3212.4 / 0.0 ms last resort GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

@ButuzGOL ButuzGOL changed the title Home example Readme example Mar 21, 2018
@ButuzGOL ButuzGOL changed the title Readme example Readme example fail Mar 21, 2018
@rxaviers
Copy link
Member

I don't get the same issue. Can you provide additional information such as operating system, node and npm version.

@ButuzGOL
Copy link
Author

➜  ~ node -v
v8.9.1
➜  ~ npm -v
5.5.1

Using with webpack

@rxaviers
Copy link
Member

Can you create a gist with a reduced code that reproduces this problem please? Did you have issues installing cldr-data (i.e., rxaviers/cldr-data-npm#49)?

@ButuzGOL
Copy link
Author

ButuzGOL commented Mar 27, 2018

Code

var Globalize = require( "globalize" );
Globalize.load( require( "cldr-data" ).entireSupplemental() );
Globalize.load( require( "cldr-data" ).entireMainFor( "en", "pt" ) );

var en = new Globalize( "en" );

// You can optionally omit the `new` operator.
var pt = Globalize( "pt" );

console.log(en.formatNumber( 3.1415 ));
// > 3.142

console.log(pt.formatNumber( 3.1415 ));
new GlobalizePlugin({
  production: false,
  developmentLocale: "en",
  supportedLocales: ["en", "pt", "es"],
})
"cldr-data": ">=25",
"globalize": "^1.3.0",
"globalize-webpack-plugin": "0.4.x",
"iana-tz-data": "^2017.1.0",

@xehpuk
Copy link

xehpuk commented Mar 28, 2018

Same problem here. [email protected] and [email protected].

rxaviers/cldr-data-npm#55

@rxaviers
Copy link
Member

When using globalize webpack plugin, one isn't supposed to use cldr-data.

Closing this in favor of rxaviers/cldr-data-npm#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants