Hi All,

I refactored some of the code from a large screen into multiple web blocks, and now I am getting a compilation error while publishing. Can you please let me know what it could be causing it?

The error is as follows:


Internal Error
Invalid compiler output.
Should be of type OutSystems.HubEdition.Compiler.NRFlows+AbstractClientScreenActionFlow instead of WebBlockCustomEvent
Exception Details:
[1] System.InvalidOperationException: Should be of type OutSystems.HubEdition.Compiler.NRFlows+AbstractClientScreenActionFlow instead of WebBlockCustomEvent
   at DebugExtensions.MustBe[Type](Object obj)
   at OutSystems.HubEdition.Compiler.Languages.JavaScript.JSRefreshItemActionCodeGenerator.<GenerateOnAfterFetchCall>d__2.MoveNext()
   at OutSystems.RuntimeCommon.CollectionsExtensions.IsEmpty[T](IEnumerable`1 enumerable)
   at OutSystems.HubEdition.Compiler.Languages.JavaScript.JSAsyncCodeFactory.ReturnCallThen(Expression previousPromise, IEnumerable`1 statements)
   at OutSystems.HubEdition.Compiler.Languages.JavaScript.DataCallBuilder.Build()
   at OutSystems.HubEdition.Compiler.Languages.JavaScript.JSRefreshItemActionCodeGenerator.GenerateRefreshData(IRefreshQueryTarget target)
   at OutSystems.HubEdition.Compiler.NewRuntime.Controller.ControllerCodeGenerator.GetDefinitions(IEnumerable`1 targets)
   at OutSystems.HubEdition.Compiler.NewRuntime.Controller.ControllerCodeGenerator.GetControllerClassCode(IViewWithController objectWithController)
   at OutSystems.HubEdition.Compiler.NewRuntime.Controller.ControllerCodeGenerator.Visit(IViewWithController viewWithController, TextWriter writer)
   at OutSystems.HubEdition.Compiler.NRNodes.AbstractWebInteractiveContentNode.DumpAllInOne()
   at OutSystems.HubEdition.Compiler.NRNodes.AbstractWebInteractiveContentNode.Dump()
   at OutSystems.HubEdition.Compiler.NRFlows.WebFlow.Dump()
   at OutSystems.HubEdition.Compiler.WebFlows.WebHandler.Dump(IEnumerable`1 webFlows)
   at OutSystems.HubEdition.Compiler.ESpace.Dump()
   at OutSystems.HubEdition.Compiler.Compiler.DumpEspaceCode(ESpace eSpace, CompilationContext context)
   at OutSystems.HubEdition.Compiler.Compiler.InnerGenerateCode(ESpace eSpace, CompilationContext context, Nullable`1 isIsolatedInServer)
   at OutSystems.HubEdition.Compiler.Utils.CompilerUtils.TrapExceptionsInContext(Action action, CompilationContext context)

Hi, 

This seems to be something related to the internal state of the app in Service Studio...

Can you try to "Merge" the last published version with the local version before trying to publish it?

Cheers.

Solution

Hi Eduardo,


I managed to fix the problem. It was caused by one of the blocks as follows:


1. I had a Data Action executed on-start only. There was a warning that the action wasn't used anywhere else.

2. The Data Action's On After Fetch pointed to an Event.

3. Because the Data Action "wasn't being used", the Event was never triggered. I got a warning for this, as well.


The warnings seemed innocent enough, but they lead to a compilation error. This is maybe something that OS team could look into.


Thanks!

Solution

Hello Tarik, 

Thank you very much for this insight. 

I'll pass it to OutSystems so they can take a look on it. 

Cheers! 

P.S. I marked your answer as the solution

Hi Tarik,

It seems to be a bug on the platform, when you have events as handlers of an "of after fetch" property.

I'll let you know once we've addressed the issue.

Thanks for reporting it.

Ricardo Alves