Stops loading angular app at Intl.NumberFormat

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Stops loading angular app at Intl.NumberFormat

Postby amonty » Tue Aug 27, 2019 4:37 pm

I've asked this on StackOverflow (https://stackoverflow.com/questions/57665907/cefsharp-stops-loading-at-intl-numberformat) but am C&P to ask here:

I have an Angular 7 client-side app that I am running both independently in a browser and within a Windows Forms application using CefSharp (v75.1.141 which is a wrapper for CEF, version 75.1.14+gc81164e+chromium-75.0.3770.100 based on Chromium version 75.0.3770.100). One of my angular services makes a call to the javascript Intl namespace:
Code: Select all
    constructor() {
        console.log("FormattersService constructor start");
        try {
            this.currencyFormatter = new Intl.NumberFormat("en-NZ", { style: "currency", currency: "NZD" });
        } catch (error) {
            console.error("FormattersService call to Intl.NumberFormat error", error);
        }
        console.log("FormattersService constructed...after call to Intl.NumberFormat");
    }

I've also tried replacing the "en-NZ" with the array ["en-NZ", "en-GB"], also ["en-NZ", "en-GB", "en"], and also just replacing it with "en-GB", all with the same result.

While this service (which is DI into a component) is happily constructed in any browser I've tested it in, it completely bombs in my CefSharp browser form. Logging the console (via ChromiumWebBrowser.ConsoleMessage event) ends with the line:

FormattersService constructor start

i.e. no error is caught, and it doesn't get to the end. The whole app just seems to stop and there's no explanation.

Any help with either using the Intl javascript locales in CefSharp/chromium, or using CefSharp to find out exactly what is going on?

I am aware of the cef locales, and have the en-GB.pak in a locales folder that CefSharp knows about (via CefSettings.LocalsDirPath) and have set Locale to en-GB, but I believe this is not related (i.e. just sets up the "browser" language).

Further to this, I've now removed the dependency on Intl and the FormattersService now gets constructed without a hitch, as do all the other dependencies of my component, but my component now still never makes it to its constructor. I have other similar components/pages that load fine. This really has got me to head+brick wall territory.
amonty
Newbie
 
Posts: 2
Joined: Tue Aug 27, 2019 4:20 pm

Re: Stops loading angular app at Intl.NumberFormat

Postby amonty » Wed Aug 28, 2019 11:50 pm

Issue ended up being an out-of-date cef icudtl.dat file.

Updated this and now
Code: Select all
Intl.NumberFormat
and
Code: Select all
val.toLocaleString
are no longer stalling load of application.
amonty
Newbie
 
Posts: 2
Joined: Tue Aug 27, 2019 4:20 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 104 guests