Azure / Azure/azure-functions-core-tools
Clean up "Can't determine project language" and AspNetCore messages
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 15
Description
When I run `func start` I get these messages. Not sure how to get rid of them
```
func start
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Azure Functions Core Tools
Core Tools Version: 3.0.3904 Commit hash: c345f7140a8f968c5dbc621f8a8374d8e3234206 (64-bit)
Function Runtime Version: 3.3.1.0
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
[2021-11-15T15:39:03.091Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-11-15T15:39:03.092Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST http://127.0.0.1:53520/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'
[2021-11-15T15:39:04.615Z] Worker process started and initialized.
```
Then I tried running `func init` as per @anthonychu . I entered these values and got these results
```
▶func init
Select a number for worker runtime:
1. dotnet
2. dotnet (isolated process)
3. node
4. python
5. powershell
6. custom
Choose option: 3
node
Select a number for language:
1. javascript
2. typescript
Choose option: 1
javascript
package.json already exists. Skipped!
.gitignore already exists. Skipped!
host.json already exists. Skipped!
local.settings.json already exists. Skipped!
Writing /Users/papa/_git/shopathome/api/.vscode/extensions.json
```
It seems nothing changed except it added an extension recommendation. The odd language messages persist.
So I ran `func start --javascript` and the messages go away, kind of ...
```
func start --javascript
Azure Functions Core Tools
Core Tools Version: 3.0.3904 Commit hash: c345f7140a8f968c5dbc621f8a8374d8e3234206 (64-bit)
Function Runtime Version: 3.3.1.0
[2021-11-15T15:42:38.680Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-11-15T15:42:38.681Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST http://127.0.0.1:54437/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'gRPC - /AzureFunctionsRpcMessages.FunctionRpc/EventStream'
[2021-11-15T15:42:40.105Z] Worker process started and initialized.
```
And for this, it is quite confusing as a javascript dev to see AspNetCore messages.
Sharing as per chat with Anthony Chu.
Contributor guide
Research direction
Reproduce the issue from the project containing package.json, host.json, and local.settings.json by running `func start`, then compare it with `func start --javascript` and `func init`. Trace the language-detection path and the startup logging around the AspNetCore and shared-memory messages; done means the intended startup output no longer contains the misleading messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100