Azure / Azure/azure-functions-templates
EventHubTrigger-FSharp template fails to compile after creating a new F# EventHubTrigger in VS Code
- Dominant language
- C#
- Stars
- 363
- Forks
- 206
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Description
Repro:
* Install Azure Functions extension for VS Code
* Set "azureFunctions.projectLanguage": "F#" in VS Code
* Create a new function app in VS Code with "Azure Functions: Create New Project"
* Create a new EventHubTrigger function with "Azure Functions: Create Function" (switch from Verified to All to unlock the F# templates) and provide a custom name different from the default
* Add the file to the fsproj for the function app and reload the file
Expected:
* The file compiles
Actual:
* [Task.Yield() |> Async.AwaitTask](https://github.com/Azure/azure-functions-templates/blob/78353c3ca473b8c8370d9f0c9ea9c83c4e77b6f8/Functions.Templates/Templates/EventHubTrigger-FSharp/EventHubTriggerFSharp.fs#L21) fails due to type mismatch.
Error:
No overloads match for method 'AwaitTask'. The available overloads are shown below.
Possible overload: 'static member Async.AwaitTask : task:Task<'T> -> Async<'T>'. Type constraint mismatch. The type
'Runtime.CompilerServices.YieldAwaitable'
is not compatible with type
'Task<'a>'.
Possible overload: 'static member Async.AwaitTask : task:Task -> Async'. Type constraint mismatch. The type
'Runtime.CompilerServices.YieldAwaitable'
is not compatible with type
'Task'.*
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with Functions.Templates/Templates/EventHubTrigger-FSharp/EventHubTriggerFSharp.fs, especially the Task.Yield() |> Async.AwaitTask expression at line 21. Reproduce the VS Code project and custom EventHubTrigger creation steps, then confirm the generated file compiles after the type mismatch is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, fsharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100