Azure Functions: `Azure Functions Core Tools` で TypeScript/QueueTrigger の関数を `func start` 時に `Value cannot be null. (Parameter 'provider')` エラー

バージョン

  • OS: macOS Catalina 10.15.7
  • Azure Functions Core Tools: 3.0.3785
  • node: 14.17.5

遭遇したエラー

Value cannot be null. (Parameter 'provider')

$ func start

Azure Functions Core Tools
Core Tools Version:       3.0.3785 Commit hash: db6fe71b2f05d09757179d5618a07bba4b28826f  (64-bit)
Function Runtime Version: 3.2.0.0

[2021-10-01T13:16:19.680Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-10-01T13:16:19.680Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
[2021-10-01T13:16:20.590Z] A host error has occurred during startup operation '974818a2-159a-4925-a571-4d4330134e2b'.
[2021-10-01T13:16:20.590Z] Microsoft.Azure.WebJobs.Script: Did not find functions with language [node].
Value cannot be null. (Parameter 'provider')

エラー原因

  • yarn build せずに func start していた

  • function.json を下記のように設定し func start
//function.json
{
  //...
  "scriptFile": "../QueueTrigger/index.ts"
}

  • function.json を下記のように設定し、yarn build 後に func start
{
  //...
  "scriptFile": "../dist/QueueTrigger/index.js"
}

ハマった事

  • Value cannot be null. (Parameter 'provider') についてはいくつも issue が上がっており、総じて ExtensionBundle 起因するエラー、解消方法は、host.json から extensionBundle を削除、というものだった。

  • 今回のケースでは ExtensionBundle とは関連はなかった にも関わらず、上記の issue で示されている work around で試行錯誤してしまった。

解決のきっかけ

  • JavaScript/QueueTrigger ではエラーにならなかった為、index.ts に起因するエラーではないか、とあたりがついた。