App works in simulator but not in browser

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
Ajcek
Posts: 7
Joined: Thu Mar 09, 2017 7:03 am

App works in simulator but not in browser

Postby Ajcek » Mon Mar 05, 2018 10:06 am

Hi

Mi app runs in the simulator without problems. However when I try to open it in browser I get the following error:

Uncaught TypeError: $T08(...).Repeat$b1 is not a function
at Manufaktura_Controls_XamlForHtml5_Test_MainPage.MainPage__ctor (Manufaktura.Controls.XamlForHtml5.Test.js?2018351823:243)
at new Manufaktura_Controls_XamlForHtml5_Test_MainPage (Manufaktura.Controls.XamlForHtml5.Test.MainPage:17)
at Manufaktura_Controls_XamlForHtml5_Test_App.App__ctor (Manufaktura.Controls.XamlForHtml5.Test.js?2018351823:91)
at new Manufaktura_Controls_XamlForHtml5_Test_App (Manufaktura.Controls.XamlForHtml5.Test.App:17)
at runMain (index.html:33)
at browserFinishedLoadingCallback (JSIL.Browser.js?2018351823:1138)

I commented out Enumerable.Repeat which I thought was causing the problem:
//score.FirstStaff.Elements.AddRange(StaffBuilder
// .FromPitches(Pitch.ChromaticRange(Pitch.C4, Pitch.C5, Pitch.MidiPitchTranslationMode.Auto).ToArray())
// .AddRhythm(Enumerable.Repeat(4, 12).ToArray()));

But then I received bunch of other errors from other functions in my code like:

JSIL.Browser.js?2018351858:199 Unhandled exception in static constructor for type Manufaktura.Controls.Parser.MusicXml.MusicXmlParsingStrategy:
at Object.JSIL.$InvokeStaticConstructor (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:4562:17)
at Object.JSIL.RunStaticConstructors (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:4595:12)
at JSIL.PreInitMembrane.MaybeRunStaticConstructors [as initializer] (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:4223:10)
at JSIL.PreInitMembrane.maybeInit (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:612:10)
at JSIL.PreInitMembrane.bound_maybeInit [as maybeInit] (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:592:16)
at Object.JSIL.InitializeType (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:4528:39)
at Object.RegisterName_getter (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:1972:14)
at Object.LazyValueProperty_Get [as MusicXmlParsingStrategy] (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:234:26)
at JSIL.ResolvedName.get (file:///C:/Development/manufakturalibraries/Manufaktura.Controls.XamlForHtml5.Test/bin/Debug/Output/app-cshtml5/libs/JSIL.Core.js?2018351858:1004:21

Why does it behave differently in simulator and in the browser?

This is my compilation log:
C#/XAML for HTML5: JavaScriptGenerator started for assembly "C:\Development\manufakturalibraries\Manufaktura.Controls.XamlForHtml5.Test\bin\Debug\Manufaktura.Controls.XamlForHtml5.Test.dll".
WARNING: Unknown custom metadata item kind: 6
WARNING: Unknown custom metadata item kind: 6
WARNING: Unknown custom metadata item kind: 6
WARNING: Unknown custom metadata item kind: 6
Decompiling
done
Writing JavaScript
done
C#/XAML for HTML5: JavaScriptGenerator completed in 4 seconds.
C#/XAML for HTML5: Wrapper started. Source libraries directory: "System.String[]". Assembly that contains entry point: "C:\Development\manufakturalibraries\Manufaktura.Controls.XamlForHtml5.Test\bin\Debug\Manufaktura.Controls.XamlForHtml5.Test.dll
C#/XAML for HTML5: Wrapper completed in 0 seconds.


COMPILATION SUCCEEDED

Ajcek
Posts: 7
Joined: Thu Mar 09, 2017 7:03 am

Re: App works in simulator but not in browser

Postby Ajcek » Wed Mar 14, 2018 12:26 am

Hi

Do you have any solution by any chance? :)

I see that there is a similar post: viewtopic.php?f=4&t=8183
The author says that "script has to be a compile time value" but I don't know what he is referring to and if it is related to my problem.

JS-Support @Userware
Site Admin
Posts: 912
Joined: Tue Apr 08, 2014 3:42 pm

Re: App works in simulator but not in browser

Postby JS-Support @Userware » Thu Mar 22, 2018 7:56 am

Hi,
Sorry we are short staffed this week, please expect a reply in the coming days.
Thanks
JS-Support


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests

 

 

cron