vscode-azurefunctions icon indicating copy to clipboard operation
vscode-azurefunctions copied to clipboard

functions not listed after build in vscode workspace

Open Venipa opened this issue 1 year ago • 4 comments

Does this occur consistently? Yes Repro steps: folder: src/functions/[functionName]/index.ts in package json:

{
// ...
  "main": "dist/src/functions/*/index.js",
// ...
}
  1. tsc -- function handlers will be generated to dist/src/functions/[name]/index.js
  2. image

site note: running func host start --verbose will load the functions without problems

Version: 1.15.3 OS: win32 OS Release: 10.0.22631 Product: Visual Studio Code Product Version: 1.90.2 Language: en

Venipa avatar Aug 27 '24 17:08 Venipa

Hi @Venipa,

Because of the new programming model for node.js, without the bindings file, there isn't a way for us to know which triggers exist prior to starting the host.

We should have a warning indicating that like we do for other languages that require running to list the triggers, such as .NET.

nturinski avatar Aug 28 '24 18:08 nturinski

hmm, ok i've also found out that for some reason the functions wont be found on a fresh new functions instance hosted by azure. but our dev instance of azure functions finds them? (even without the bindings file) the wwwroot is the same for both instance, same settings, same app settings

but thats for a different repo to issue about

ill try auto generating bindings with a bundler like esbuild for now

Venipa avatar Aug 28 '24 19:08 Venipa

@nturinski

Hi @Venipa,

Because of the new programming model for node.js, without the bindings file, there isn't a way for us to know which triggers exist prior to starting the host.

We should have a warning indicating that like we do for other languages that require running to list the triggers, such as .NET.

so i just build the functions with a function.json in dist/ pointing to the script file in dist/src/functions/[name of function]/index.js but still it isnt listed

Venipa avatar Aug 29 '24 07:08 Venipa

i've just set these vscode settings

"azureFunctions.projectSubpath": "src/functions",
"azureFunctions.functionSubpath": "src/functions",

and it works for now

Venipa avatar Aug 29 '24 08:08 Venipa