Logic Apps Standard (VS Code) inline javascript not working locally
Hi,
I am trying to run a Logic App (Standard) in VS Code which contains an 'Execute JavaScript Code' action as follows:

And in the response I'm returning the output of the inline JavaScript action. But when I try to run this locally (with Azurite started), I get the following error:
[2022-08-15T20:21:10.053Z] Workflow Error: operationName='WorkflowDefinitionProvider.ProcessWorkflow', message='Workflow 'workflow-sf-echo-http-request' validate and create workflow operation failed, the exception is 'The input parameter 'code' for inline code action 'Execute_JavaScript_Code' contains invalid code. Parsing the code failed with error 'Node worker did not start properly ('30' second timeout).'.'', exception='Microsoft.Azure.Workflows.Common.ErrorResponses.ErrorResponseMessageException: The input parameter 'code' for inline code action 'Execute_JavaScript_Code' contains invalid code. Parsing the code failed with error 'Node worker did not start properly ('30' second timeout).'.
[2022-08-15T20:21:10.058Z] ---> Microsoft.Azure.Workflows.Common.ErrorResponses.ErrorResponseMessageException: Node worker did not start properly ('30' second timeout).
[2022-08-15T20:21:10.061Z] at Microsoft.Azure.Workflows.Languages.Edge.JScript.Engines.NodeProcessHandler.StartNodeProcess()
[2022-08-15T20:21:10.075Z] at Microsoft.Azure.Workflows.Languages.Edge.JScript.Engines.NodeProcessHandler.StartNodeProcessIfNotStarted()
[2022-08-15T20:21:10.082Z] at Microsoft.Azure.Workflows.Languages.Edge.JScript.Engines.JavascriptAnalysisEngine.FindDependencies(String actionName, String javascript)
[2022-08-15T20:21:10.085Z] at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.GetActionDependencies(String actionName, String actionCode)
[2022-08-15T20:21:10.094Z] --- End of inner exception stack trace ---
[2022-08-15T20:21:10.096Z] at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.GetActionDependencies(String actionName, String actionCode)
[2022-08-15T20:21:10.098Z] at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.<GetInlineCodeActionsGeneratedDependencies>b__10_3(KeyValuePair`2 actionKvp)
[2022-08-15T20:21:10.100Z] at Microsoft.WindowsAzure.ResourceStack.Common.Extensions.ConcurrencyExtensions.AggregateOperationsConcurrently[TElement,TResult,TAccumulate](IEnumerable`1 source, Func`2 operation, TAccumulate seed, Func`3 accumulator, Int32 concurrencyLimit, CancellationToken cancellationToken)
[2022-08-15T20:21:10.102Z] at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.GetInlineCodeActionsGeneratedDependencies(FlowPropertiesDefinition definition)
[2022-08-15T20:21:10.104Z] at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.GetTemplateRuntimeContext(FlowPropertiesDefinition definition, String flowName, Flow existingFlow, EdgeConnectionReferencesDefinition edgeConnectionReferencesDefinition)
[2022-08-15T20:21:10.131Z] at Microsoft.Azure.Workflows.Web.Engines.EdgeFlowWebManagementEngine.ValidateAndCreateFlow(String flowName, FlowPropertiesDefinition flowPropertiesDefinition)
[2022-08-15T20:21:10.166Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.Retry(Func`1 action, Int32 retryCount, TimeSpan retryInterval, CancellationToken cancellationToken, Nullable`1 retryTimeout, Func`2 isRetryable, Action`1 errorAction, Func`2 retryAfter)
[2022-08-15T20:21:10.168Z] at Microsoft.WindowsAzure.ResourceStack.Common.Algorithms.AsyncRetry.Retry(Func`1 action, Int32 retryCount, TimeSpan retryInterval, CancellationToken cancellationToken, Nullable`1 retryTimeout, Func`2 isRetryable, Action`1 errorAction, Func`2 retryAfter)
[2022-08-15T20:21:10.191Z] at Microsoft.Azure.Workflows.WebJobs.Extensions.Initialization.WorkflowFunctionDefinitionProvider.ProcessWorkflow(FlowFunction flowFunction, ConcurrentDictionary`2 flowsProcessed)', extensionVersion='1.0.0.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='b3bb7242-afd2-4cf1-851c-99dfe35058a4'
I have the following setup
- Visual Studio Code (Version 1.70.1, User setup)
- Azure Logic Apps (Standard) Extension (v1.0.25)
- Azurite Extension (v3.16.0 - when I upgrade to latest version I can't run my Logic Apps after making changes to them in the designer)
- Node (v14.20.0)
Am I missing something? Btw I tried creating the exact same logic app through the Azure Portal and it runs within Azure just fine.
Same for me. It does not work locally.
I downgraded node to version 12.12.22. Now I'm getting the following error message when I try to run it locally:
validate and create workflow operation failed, the exception is ''The requested address is not valid in its context.'. Status code: 'InternalServerError'.'', exception='Microsoft.Azure.Workflows.Common.ErrorResponses.ErrorResponseMessageException: 'The requested address is not valid in its context.'. Status code: 'InternalServerError'.
The reason is that the analysis service is being called incorrectly. I've posted a workaround to get it running before you test out your code. https://github.com/Azure/logicapps/issues/586
This issue is stale because it has been open for 30 days with no activity.
Moved #586 to discussions to highlight the work around for the time being. Something we have noted and will look at in the future.