vscode-azurefunctions: Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:5858)

I’m facing a weird issue.

Error:

Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:5858).
VSCode 1.23.1
MacOS 
Node: 10.1.0
OS: macOS Sierra
npm: 6.0.1
Chrome: 66.0.3359.181

Launch.json

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Attach to JavaScript Functions",
			"type": "node",
			"request": "attach",
			"port": 5858,
			"protocol": "inspector",
			"preLaunchTask": "runFunctionsHost"
		}
	]
}

image

Trying to create an Azure function.

Several errors in my terminal output:


> Executing task: func host start <


                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Hosting environment: Production
Content root path: /Users/$USER/Documents/Web/Sandbox/afn
Now listening on: http://localhost:7071
Application started. Press Ctrl+C to shut down.
[5/19/18 8:24:57 PM] Reading host configuration file '/Users/$USER/Documents/Web/Sandbox/afn/host.json'
[5/19/18 8:24:57 PM] Host configuration file read:
[5/19/18 8:24:57 PM] {}
[5/19/18 8:24:57 PM] Starting Host (HostId=ahmadsmacbookpro-763423413, InstanceId=50434726-525b-4afa-9566-a137447a193f, Version=2.0.11651.0, ProcessId=98058, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[5/19/18 8:24:57 PM] Unable to configure java worker. Could not find JAVA_HOME app setting.
[5/19/18 8:24:57 PM]
[5/19/18 8:24:57 PM] Could not configure language worker Java.
[5/19/18 8:24:57 PM]
[5/19/18 8:24:57 PM] Start Process: node  --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 55405 --workerId 33587250-9112-4a07-a373-8572a42396da --requestId 53993c42-bc16-4358-ab64-074a66876e11
[5/19/18 8:24:57 PM] Debugger listening on port 5858.
[5/19/18 8:24:57 PM] Warning: This is an experimental feature and could change at any time.
[5/19/18 8:24:57 PM] To start debugging, open the following URL in Chrome:
[5/19/18 8:24:57 PM]     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/a514a2fa-8b05-47f9-b371-79afd68b44c5
[5/19/18 8:24:57 PM] Generating 1 job function(s)
[5/19/18 8:24:57 PM] Found the following functions:
[5/19/18 8:24:57 PM] Host.Functions.HttpTriggerJS
[5/19/18 8:24:57 PM]
[5/19/18 8:24:57 PM] Host initialized (656ms)
[5/19/18 8:24:57 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/19/18 8:24:57 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/19/18 8:24:57 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/19/18 8:24:57 PM] Host started (687ms)
[5/19/18 8:24:57 PM] Job host started
[5/19/18 8:24:57 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/19/18 8:24:57 PM] module.js:472
[5/19/18 8:24:57 PM]     throw err;
[5/19/18 8:24:57 PM]     ^
[5/19/18 8:24:57 PM] Error: Cannot find module './Worker.js'
[5/19/18 8:24:57 PM]     at Function.Module._resolveFilename (module.js:470:15)
[5/19/18 8:24:57 PM]     at Function.Module._load (module.js:418:25)
[5/19/18 8:24:57 PM]     at Module.require (module.js:498:17)
[5/19/18 8:24:57 PM]     at require (internal/module.js:20:19)
[5/19/18 8:24:57 PM]     at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/dist/src/nodejsWorker.js:8:14)
[5/19/18 8:24:57 PM]     at Module._compile (module.js:571:32)
[5/19/18 8:24:57 PM]     at Object.Module._extensions..js (module.js:580:10)
[5/19/18 8:24:57 PM]     at Module.load (module.js:488:32)
[5/19/18 8:24:57 PM]     at tryModuleLoad (module.js:447:12)
[5/19/18 8:24:57 PM]     at Function.Module._load (module.js:439:3)
[5/19/18 8:24:57 PM] Worker encountered an error.
[5/19/18 8:24:57 PM] Worker process with pid 98060 exited with code 1.
[5/19/18 8:24:57 PM] Start Process: node  --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 55405 --workerId fa3f45e4-eb03-424a-903f-e3e25ee692ad --requestId e3ec9f82-c612-4706-be84-aff784a88ff4
[5/19/18 8:24:57 PM] Debugger listening on port 5858.
[5/19/18 8:24:57 PM] Warning: This is an experimental feature and could change at any time.
[5/19/18 8:24:57 PM] To start debugging, open the following URL in Chrome:
[5/19/18 8:24:57 PM]     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/XXXXX-0e65-47d6-b569-63693636c245
Listening on http://localhost:7071/
Hit CTRL-C to exit...

Http Functions:

        HttpTriggerJS: http://localhost:7071/api/HttpTriggerJS

[5/19/18 8:24:57 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/19/18 8:24:57 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/19/18 8:24:57 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/19/18 8:24:58 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/19/18 8:24:58 PM] module.js:472
[5/19/18 8:24:58 PM]     throw err;
[5/19/18 8:24:58 PM]     ^
[5/19/18 8:24:58 PM] Error: Cannot find module './Worker.js'
[5/19/18 8:24:58 PM]     at Function.Module._resolveFilename (module.js:470:15)
[5/19/18 8:24:58 PM]     at Function.Module._load (module.js:418:25)
[5/19/18 8:24:58 PM]     at Module.require (module.js:498:17)
[5/19/18 8:24:58 PM]     at require (internal/module.js:20:19)
[5/19/18 8:24:58 PM]     at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/dist/src/nodejsWorker.js:8:14)
[5/19/18 8:24:58 PM]     at Module._compile (module.js:571:32)
[5/19/18 8:24:58 PM]     at Object.Module._extensions..js (module.js:580:10)
[5/19/18 8:24:58 PM]     at Module.load (module.js:488:32)
[5/19/18 8:24:58 PM]     at tryModuleLoad (module.js:447:12)
[5/19/18 8:24:58 PM]     at Function.Module._load (module.js:439:3)
[5/19/18 8:24:58 PM] Worker encountered an error.
[5/19/18 8:24:58 PM] Worker process with pid 98062 exited with code 1.
[5/19/18 8:24:58 PM] Start Process: node  --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 55405 --workerId e50dd0da-8419-49b8-8a25-87520752a694 --requestId 71f7ab6c-a836-4d57-b0f8-8f9d541f6b4d
[5/19/18 8:24:58 PM] Debugger listening on port 5858.
[5/19/18 8:24:58 PM] Warning: This is an experimental feature and could change at any time.
[5/19/18 8:24:58 PM] To start debugging, open the following URL in Chrome:
[5/19/18 8:24:58 PM]     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/as-631d-4dfe-b7da-7e9ccf4379e9
[5/19/18 8:24:58 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/19/18 8:24:58 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/19/18 8:24:58 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/19/18 8:24:58 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/19/18 8:24:58 PM] module.js:472
[5/19/18 8:24:58 PM]     throw err;
[5/19/18 8:24:58 PM]     ^
[5/19/18 8:24:58 PM] Error: Cannot find module './Worker.js'
[5/19/18 8:24:58 PM]     at Function.Module._resolveFilename (module.js:470:15)
[5/19/18 8:24:58 PM]     at Function.Module._load (module.js:418:25)
[5/19/18 8:24:58 PM]     at Module.require (module.js:498:17)
[5/19/18 8:24:58 PM]     at require (internal/module.js:20:19)
[5/19/18 8:24:58 PM]     at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/dist/src/nodejsWorker.js:8:14)
[5/19/18 8:24:58 PM]     at Module._compile (module.js:571:32)
[5/19/18 8:24:58 PM]     at Object.Module._extensions..js (module.js:580:10)
[5/19/18 8:24:58 PM]     at Module.load (module.js:488:32)
[5/19/18 8:24:58 PM]     at tryModuleLoad (module.js:447:12)
[5/19/18 8:24:58 PM]     at Function.Module._load (module.js:439:3)
[5/19/18 8:24:58 PM] Worker encountered an error.
[5/19/18 8:24:58 PM] Worker process with pid 98063 exited with code 1.

Help.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 34 (13 by maintainers)

Commits related to this issue

Most upvoted comments

NOTE: When running on a non-Windows machine, the environment name should be workers__node__Debug. This is case sensitive, so the capital D is important.

I’m on node v8.6. It seems like ‘–inspect=5858’ isn’t being passed in to the node process like it used to be.

This is what I see in the log for .25:

[5/21/18 4:40:40 PM] Start Process: node  --inspect=5858 "/usr/local/lib/node_modules/azure-functions-core-tools/bin/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 51227 --workerId 04953aea-a873-4869-a00b-9eb63d076fae --requestId 149e08dc-3a23-478e-9628-7961ee098ea4

This is what I see in the log for .26:

[5/21/18 4:35:45 PM] Start Process: node  "/usr/local/lib/node_modules/azure-functions-core-tools/bin/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 51085 --workerId 979575bb-fd9e-43aa-bfa8-c1a7df12064f --requestId 59b1b809-55d4-4bd3-9ed8-2a6c866df4c0 --grpcMaxMessageLength 134217728

@ahmadawais - This line in your error log shows that VS Code thinks your version of node is an unsupported older version (I think).

5/19/18 8:24:58 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.25/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'

I was experiencing a similar issue with VS Code thinking I was using v10.x of node. I found that it is due to how nvm interacts with shell environments and how VS Code loads the node version based on what is aliased as the default. See this SO Q&A for more info: Visual Studio Code to use node version specified by NVM

The only suggested solution that worked for me was to set nvm alias default 8.11.2 in the terminal and restart VS Code. Not my preferred choice, but it works. You need to set your default alias to something in the v8.x range. It doesn’t look like extension binaries are available for later versions of node.

> ls -l /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary
total 0
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v48-win32-ia32
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v57-darwin-ia32
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v57-darwin-x64
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v57-linux-ia32
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v57-linux-x64
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v57-win32-ia32
drwxr-xr-x  3 someone  staff  96 Jun  7 19:43 node-v57-win32-x64

NOTE: Setting the runtimeExecutable attribute in launch.json, for the debugger, will not work due to it only being available for request types of launch, not attach. See: Launch configuration attributes

@EricJizbaMSFT and @pragnagopa would making the runtimeExecutable attribute available for request types of attach be feasible? I would much rather set that in the config than muck with my nvm default.

@ahmadawais I’ll echo what @pragnagopa said. There were two issues here - one directly related to VS Code (which was fixed) and one specific to the azure-functions-nodejs-worker. I don’t think there’s anything we could do from the VS Code side to fix your issue and I recommend investigating it further in the repo she mentioned: https://github.com/Azure/azure-functions-nodejs-worker

@EricJizbaMSFT I can confirm that it’s still not working for me on MacOS. 😦

I ran

brew upgrade azure-functions-core-tools

OUTPUT

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

Error: azure/functions/azure-functions-core-tools 2.0.1-beta.28 already installed

When I create an Azure function, let’s say HTTP triggered JavaScript based function. And press play in the debug the following is what I get as output in my terminal.

TERMINAL OUTPUT (CLICK TO EXPAND!)

> Executing task: func host start <


                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Hosting environment: Production
Content root path: /Users/ahmadawais/Documents/Web/Sandbox/demo-azure-func
Now listening on: http://localhost:7071
Application started. Press Ctrl+C to shut down.
[5/31/18 11:58:20 PM] Reading host configuration file '/Users/ahmadawais/Documents/Web/Sandbox/demo-azure-func/host.json'
[5/31/18 11:58:20 PM] Host configuration file read:
[5/31/18 11:58:20 PM] {}
[5/31/18 11:58:20 PM] Starting Host (HostId=ahmadsmacbookpro-1530556110, InstanceId=2485c474-9ed2-4041-b716-b11e819adb18, Version=2.0.11776.0, ProcessId=60925, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[5/31/18 11:58:20 PM] Loading all the worker providers from the default workers directory: /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers
[5/31/18 11:58:20 PM] Found worker config: /usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/python/worker.config.json
[5/31/18 11:58:20 PM] Will load worker provider for language: python
[5/31/18 11:58:20 PM] Start Process: node  --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 64239 --workerId eb429ee4-d00a-4aa9-8ea1-3b9b62facfb0 --requestId 7bd13f1f-4b9b-478f-89ca-61e32683718d --grpcMaxMessageLength 134217728
[5/31/18 11:58:20 PM] Generating 1 job function(s)
[5/31/18 11:58:20 PM] Found the following functions:
[5/31/18 11:58:20 PM] Host.Functions.HttpTriggerJS
[5/31/18 11:58:20 PM]
[5/31/18 11:58:20 PM] Host initialized (834ms)
[5/31/18 11:58:20 PM] Host started (881ms)
[5/31/18 11:58:20 PM] Job host started
[5/31/18 11:58:20 PM] Debugger listening on port 5858.
[5/31/18 11:58:20 PM] Warning: This is an experimental feature and could change at any time.
[5/31/18 11:58:20 PM] To start debugging, open the following URL in Chrome:
[5/31/18 11:58:20 PM]     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/38025454-03f3-4ff6-a096-f10c16bf46da
Listening on http://localhost:7071/
Hit CTRL-C to exit...

Http Functions:

        HttpTriggerJS: http://localhost:7071/api/HttpTriggerJS

[5/31/18 11:58:21 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/31/18 11:58:21 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/31/18 11:58:21 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/31/18 11:58:21 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/31/18 11:58:21 PM] module.js:472
[5/31/18 11:58:21 PM]     throw err;
[5/31/18 11:58:21 PM]     ^
[5/31/18 11:58:21 PM] Error: Cannot find module './Worker.js'
[5/31/18 11:58:21 PM]     at Function.Module._resolveFilename (module.js:470:15)
[5/31/18 11:58:21 PM]     at Function.Module._load (module.js:418:25)
[5/31/18 11:58:21 PM]     at Module.require (module.js:498:17)
[5/31/18 11:58:21 PM]     at require (internal/module.js:20:19)
[5/31/18 11:58:21 PM]     at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js:8:14)
[5/31/18 11:58:21 PM]     at Module._compile (module.js:571:32)
[5/31/18 11:58:21 PM]     at Object.Module._extensions..js (module.js:580:10)
[5/31/18 11:58:21 PM]     at Module.load (module.js:488:32)
[5/31/18 11:58:21 PM]     at tryModuleLoad (module.js:447:12)
[5/31/18 11:58:21 PM]     at Function.Module._load (module.js:439:3)
[5/31/18 11:58:21 PM] Worker encountered an error.
[5/31/18 11:58:21 PM] Worker process with pid 60936 exited with code 1.
[5/31/18 11:58:21 PM] Start Process: node  --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 64239 --workerId 13d9c4eb-ef83-4269-a3a4-96c2d21d36f7 --requestId e1d8dc1b-f79c-49f6-af53-0f06131750b1 --grpcMaxMessageLength 134217728
[5/31/18 11:58:21 PM] Debugger listening on port 5858.
[5/31/18 11:58:21 PM] Warning: This is an experimental feature and could change at any time.
[5/31/18 11:58:21 PM] To start debugging, open the following URL in Chrome:
[5/31/18 11:58:21 PM]     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/404b2994-7fe4-482c-a4d9-47b162c9c016
[5/31/18 11:58:21 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/31/18 11:58:21 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/31/18 11:58:21 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/31/18 11:58:21 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/31/18 11:58:21 PM] module.js:472
[5/31/18 11:58:21 PM]     throw err;
[5/31/18 11:58:21 PM]     ^
[5/31/18 11:58:21 PM] Error: Cannot find module './Worker.js'
[5/31/18 11:58:21 PM]     at Function.Module._resolveFilename (module.js:470:15)
[5/31/18 11:58:21 PM]     at Function.Module._load (module.js:418:25)
[5/31/18 11:58:21 PM]     at Module.require (module.js:498:17)
[5/31/18 11:58:21 PM]     at require (internal/module.js:20:19)
[5/31/18 11:58:21 PM]     at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js:8:14)
[5/31/18 11:58:21 PM]     at Module._compile (module.js:571:32)
[5/31/18 11:58:21 PM]     at Object.Module._extensions..js (module.js:580:10)
[5/31/18 11:58:21 PM]     at Module.load (module.js:488:32)
[5/31/18 11:58:21 PM]     at tryModuleLoad (module.js:447:12)
[5/31/18 11:58:21 PM]     at Function.Module._load (module.js:439:3)
[5/31/18 11:58:21 PM] Worker encountered an error.
[5/31/18 11:58:21 PM] Worker process with pid 60938 exited with code 1.
[5/31/18 11:58:21 PM] Start Process: node  --inspect=5858 "/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js" --host 127.0.0.1 --port 64239 --workerId 730f8528-4b09-4340-8d85-4f3e67a7b033 --requestId cbc03b01-628f-436c-bf82-3eafd59fd699 --grpcMaxMessageLength 134217728
[5/31/18 11:58:21 PM] Debugger listening on port 5858.
[5/31/18 11:58:21 PM] Warning: This is an experimental feature and could change at any time.
[5/31/18 11:58:21 PM] To start debugging, open the following URL in Chrome:
[5/31/18 11:58:21 PM]     chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5858/ccb6f279-c7d1-4bfe-a13a-49f79db2dbf7
[5/31/18 11:58:21 PM] azure-functions-nodejs-worker officially supports node version >=8.4.0. Current version v7.10.0.
[5/31/18 11:58:21 PM] To install required native modules for v7.10.0, install node-pre-gyp via 'npm i -g node-pre-gyp'.
[5/31/18 11:58:21 PM] Navigate to '<node-worker-dir>/grpc' and run 'node-pre-gyp install'
[5/31/18 11:58:21 PM] Couldn't require bundle, falling back to Worker.js. Error: Cannot find module '/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/grpc/src/node/extension_binary/node-v51-darwin-x64/grpc_node.node'
[5/31/18 11:58:21 PM] module.js:472
[5/31/18 11:58:21 PM]     throw err;
[5/31/18 11:58:21 PM]     ^
[5/31/18 11:58:21 PM] Error: Cannot find module './Worker.js'
[5/31/18 11:58:21 PM]     at Function.Module._resolveFilename (module.js:470:15)
[5/31/18 11:58:21 PM]     at Function.Module._load (module.js:418:25)
[5/31/18 11:58:21 PM]     at Module.require (module.js:498:17)
[5/31/18 11:58:21 PM]     at require (internal/module.js:20:19)
[5/31/18 11:58:21 PM]     at Object.<anonymous> (/usr/local/Cellar/azure-functions-core-tools/2.0.1-beta.28/workers/node/dist/src/nodejsWorker.js:8:14)
[5/31/18 11:58:21 PM]     at Module._compile (module.js:571:32)
[5/31/18 11:58:21 PM]     at Object.Module._extensions..js (module.js:580:10)
[5/31/18 11:58:21 PM]     at Module.load (module.js:488:32)
[5/31/18 11:58:21 PM]     at tryModuleLoad (module.js:447:12)
[5/31/18 11:58:21 PM]     at Function.Module._load (module.js:439:3)
[5/31/18 11:58:21 PM] Worker encountered an error.
[5/31/18 11:58:21 PM] Worker process with pid 60939 exited with code 1.Details!


And the same error

image

Help.

Closing this issue as it has been fixed in the latest version of the func cli. The workarounds mentioned above are no longer necessary - simply update your func cli:

npm i -g azure-functions-core-tools@core

or

brew upgrade azure-functions-core-tools

It looks like this PR introduced a change in the way we check for debug port: https://github.com/Azure/azure-functions-host/commit/980107fb13e18f75be545948ede20933ea93a590.

It seems like the issue may be more fundamental though, as adding the additional environment variable (see snippet below) which sets the --inspect param correctly does not attach a debugger correctly.

"options": { "env": { "workers:node:debug": "5858" } }

==CORRECTION: adding this does work==

I’m filing an issue for this against the runtime, cc @pragnagopa