Comments (4)
oh gracious. :) i could provide a more descriptive... description...
from azure-functions-nodejs-worker.
Some people will say nvm
. But n
is 2 letters shorter. That's called "productivity".
from azure-functions-nodejs-worker.
Repro steps. Make sure you have the Azure Functions tools installed. CCing @fiveisprime FYI on the issue on that side. Also cc'ing @SyntaxC4 on the docs side, as this might be beneficial information to docs readers.
mkdir functionDebugTest
cd functionDebugTest
code .
- create a new javascript functions project using the functions explorer button
- add an httptrigger function to the project using the functions explorer button
- put a breakpoint on the first line of "real code" in the resulting
index.js
file. - "hit f5" to debug the function
At this point, one would think the debugger just goes into action, attaches, and life is grand. This, however, is not the case with Node.js v9.
In the terminal window there are a few errors that appear. At first it looks like func
is going to work fine, but then red text appears informing me:
Http Functions:
HttpTriggerJS: http://localhost:7071/api/HttpTriggerJS
[2/16/18 9:37:07 PM] A ScriptHost error has occurred
[2/16/18 9:37:07 PM] Worker process with pid 21160 exited with code 1.
If I let func
continue to run and hit the URL, I get a huge swath of error text:
[2/16/18 9:43:19 PM] Function started (Id=2413fa60-6b53-4bd5-b5a8-75366c5df475)
[2/16/18 9:43:19 PM] Executing 'Functions.HttpTriggerJS' (Reason='This function was programmatically called via the host APIs.', Id=2413fa60-6b53-4bd5-b5a8-75366c5df475)
[2/16/18 9:43:19 PM] A ScriptHost error has occurred
[2/16/18 9:43:19 PM] Exception while executing function: Functions.HttpTriggerJS. System.Private.CoreLib: One or moreerrors occurred. (Worker process with pid 21874 exited with code 1) (Worker process with pid 21877 exited with code 1) (Worker process with pid 21878 exited with code 1). Worker process with pid 21874 exited with code 1.
[2/16/18 9:43:19 PM] Exception while executing function: Functions.HttpTriggerJS. System.Private.CoreLib: One or moreerrors occurred. (Worker process with pid 21874 exited with code 1) (Worker process with pid 21877 exited with code 1) (Worker process with pid 21878 exited with code 1). Worker process with pid 21874 exited with code 1.
[2/16/18 9:43:19 PM]
[2/16/18 9:43:19 PM] Exception while executing function: Functions.HttpTriggerJS
[2/16/18 9:43:19 PM] Exception while executing function: Functions.HttpTriggerJS. System.Private.CoreLib: One or moreerrors occurred. (Worker process with pid 21874 exited with code 1) (Worker process with pid 21877 exited with code 1) (Worker process with pid 21878 exited with code 1). Worker process with pid 21874 exited with code 1.
[2/16/18 9:43:19 PM] Function completed (Failure, Id=2413fa60-6b53-4bd5-b5a8-75366c5df475, Duration=210ms)
[2/16/18 9:43:19 PM]
[2/16/18 9:43:19 PM] Executed 'Functions.HttpTriggerJS' (Failed, Id=2413fa60-6b53-4bd5-b5a8-75366c5df475)
[2/16/18 9:43:19 PM] System.Private.CoreLib: Exception while executing function: Functions.HttpTriggerJS. System.Private.CoreLib: One or more errors occurred. (Worker process with pid 21874 exited with code 1) (Worker process with pid 21877 exited with code 1) (Worker process with pid 21878 exited with code 1). Worker process with pid 21874 exited with code 1.
[2/16/18 9:43:19 PM] Function had errors. See Azure WebJobs SDK dashboard for details. Instance ID is '2413fa60-6b53-4bd5-b5a8-75366c5df475'
[2/16/18 9:43:19 PM] System.Private.CoreLib: Exception while executing function: Functions.HttpTriggerJS. System.Private.CoreLib: One or more errors occurred. (Worker process with pid 21874 exited with code 1) (Worker process with pid 21877 exited with code 1) (Worker process with pid 21878 exited with code 1). Worker process with pid 21874 exited with code 1.
How I worked around it
With the help of @burkeholland I learned of the glory of the n
package, which I used to switch to the LTS version of Node.js using the command
n lts
Now, when I run the debugger, the output is as I'd hoped/expected, and HTTP requests to the trigger work fine.
info: Worker.Node.be02b7f3-51db-4e0d-90eb-a0003a6d555e[0]
Worker be02b7f3-51db-4e0d-90eb-a0003a6d555e connecting on 127.0.0.1:49725
info: Worker.Node.be02b7f3-51db-4e0d-90eb-a0003a6d555e[0]
Debugger attached.
Listening on http://localhost:7071/
Hit CTRL-C to exit...
Http Functions:
HttpTriggerJS: http://localhost:7071/api/HttpTriggerJS
Suggestion
I think it'd be good if func
could detect the Node.js version and if it's an unsupported one (or "just 9"), halt execution and give the user a URL to learn more.
from azure-functions-nodejs-worker.
Note: The error message is improved but still buried in logs (especially for those looking at the Portal). This work item tracks increasing visibility: Azure/azure-functions-host#2299
from azure-functions-nodejs-worker.
Related Issues (20)
- No job functions found. Try making your job classes and methods public. HOT 4
- context.debug threw error HOT 2
- Javascript function with service bus trigger delivering byte message HOT 2
- Global `require` overwriting doesn't play nice with applicationinsights 2.5.1+ HOT 4
- Intermittent unknown error, lstat 'D:\home'
- Entry point errors should block app from running
- Increase timeout for `workerInit` and `functionEnvironmentReload` requests
- Create document that describes how to fix Did not find functions with language [node] HOT 1
- System.TimeoutException: The operation has timed out. at Microsoft.Azure.WebJobs.Script.Grpc.GrpcWorkerChannel.PendingItem.OnTimeout()
- Node 18; Func v4; VSCode on macOS: "No job functions found. Try making your job classes and methods public." HOT 3
- Create documentation that describes how to troubleshoot and fix `'0 functions loaded'` HOT 2
- A function can only be registered during app startup. HOT 3
- Support Node 20 HOT 1
- Azure Functions in a monorepo (Node.js) HOT 2
- Test - disregard HOT 1
- Download file from Azure Blob Storage hangs when retrieving final 1-2 blocks HOT 7
- Settings on serviceBus.clientRetryOptions is not upheld for serviceBusTopic triggers on the node worker HOT 2
- Azure function and Kudu console NODE version mismatch in linux OS azure function. HOT 8
- Node.js v4 migration - .funcignore additiona of .tsconfig.json HOT 3
- Worker init and func env reload pointing to the same app fails to register functions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-functions-nodejs-worker.