You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the option outputFormatting in H5 configuration file, transpilled JS code can be directly minified.
This worked great with Bridge.Net and also with H5, but now I have a project whose H5 compilation raises the following exception: [fail] [10:20:27] Error minifiying code. Saved output to [/path/to/tmp/file]
System.NullReferenceException: Object reference not set to an instance of an object.
H5 is actually using NUglify 1.20.7 for this operation. So using a minimal project, I tried to find the line(s) causing the NUglify exception(s), feeding it with H5's temp output.
What I found is that for an unknown reason, when I am using System.Linq functions, H5 define the type variable with a type named "?" instead of the real type name, like "Element" for example. When I manually change the "?" for the correct type name, then NUglify correctly proceeds the code ... until the next misnamed type parameter.
This problem does not occur in a systematic way, as for example in my minimal project, which is a copy-paste of several classes of the original project, type parameters are correctly transpilled. I have to admit that this project's H5 formatted result (so its beautified javascript output) is about 3.7 [Mb] (~ 32'000 lines length), which is why I'm using the minified option. I tried for example to use intermediate IEnumerable<Element> variables in C# code, but H5 keeps using "?" as type parameter value
Is there any size limit for H5 compiler? Am I doing something wrong? Any other idea?
Example illustrating transpilation error
Original C# code example (rootContainer is a H5.Core.dom.HTMLDivElement and is inherited) :
Using the option
outputFormatting
in H5 configuration file, transpilled JS code can be directly minified.This worked great with Bridge.Net and also with H5, but now I have a project whose H5 compilation raises the following exception:
[fail] [10:20:27] Error minifiying code. Saved output to [/path/to/tmp/file]
System.NullReferenceException: Object reference not set to an instance of an object.
H5 is actually using NUglify 1.20.7 for this operation. So using a minimal project, I tried to find the line(s) causing the NUglify exception(s), feeding it with H5's temp output.
What I found is that for an unknown reason, when I am using System.Linq functions, H5 define the type variable with a type named "?" instead of the real type name, like "Element" for example. When I manually change the "?" for the correct type name, then NUglify correctly proceeds the code ... until the next misnamed type parameter.
This problem does not occur in a systematic way, as for example in my minimal project, which is a copy-paste of several classes of the original project, type parameters are correctly transpilled. I have to admit that this project's H5 formatted result (so its beautified javascript output) is about 3.7 [Mb] (~ 32'000 lines length), which is why I'm using the minified option. I tried for example to use intermediate
IEnumerable<Element>
variables in C# code, but H5 keeps using "?" as type parameter valueIs there any size limit for H5 compiler? Am I doing something wrong? Any other idea?
Example illustrating transpilation error
Original C# code example (
rootContainer
is aH5.Core.dom.HTMLDivElement
and is inherited) :Javascript transpilation result of the H5 compiler (from temp saved output):
Notice the
return ($t = ?,
in the beginning of the line 8.The text was updated successfully, but these errors were encountered: