Skip to content

Cannot read properties of undefined (reading 'toLocaleLowerCase') #912

Closed

Description

@doolachen

I deployed the copilot-chat-app following the README steps. I got this error once I send any characters.
image

Activity

  1. hunk-fe commented on May 11, 2023

    @hunk-fe

    I get the same problem!

  2. hedaiping commented on May 11, 2023

    @hedaiping

    i got same problem

  3. evchaki commented on May 11, 2023

    @evchaki
    Contributor

    doolachen (@doolachen) , thank you for bringing this up. We have logged a bug and are working to fix it.

  4. BeiPoer commented on May 12, 2023

    @BeiPoer

    i got same problem

  5. doolachen commented on May 12, 2023

    @doolachen
    Author

    EvanChaki (@evchaki) , I really appreciate the effort you put into fixing this bug. I'm curious to know what caused this error. I followed the deployment process as documented, and it seems like others didn't encounter this issue. Did I miss a step somewhere, or could there be some underlying project-specific issues at play?

  6. cooptest commented on May 12, 2023

    @cooptest

    doolachen (@doolachen) There is no such error when I switch to the edge browser, but the message robot does not reply

  7. cooptest commented on May 12, 2023

    @cooptest

    doolachen (@doolachen) 换成edge浏览器不会报错,但是给机器人发消息它不回复

  8. hathind-ms commented on May 16, 2023

    @hathind-ms
    Contributor

    Can you please confirm the following:

    1. AI endpoints are set in appsettings.json - This needs to be updated in 2-3 places based on whether you want to use Planner or not. Check these sections - Completion, Embedding and/or Planner
    2. Key for AI resource is set - This can either be set using dotnet secrets or updated in appsettings.json in 2-3 places similar to step 1
    3. Confirm your webapi is running at : https://localhost:40443/probe
    4. You have a valid .env file with following values set:
    REACT_APP_BACKEND_URI=https://localhost:40443/
    REACT_APP_AAD_CLIENT_ID={Your Application (client) ID}
    REACT_APP_AAD_AUTHORITY=https://login.microsoftonline.com/common
    

    Reference this ReadMe for more details: https://github.com/microsoft/semantic-kernel/blob/main/samples/apps/copilot-chat-app/README.md

  9. teresaqhoang commented on May 16, 2023

    @teresaqhoang
    Contributor

    Hi doolachen (@doolachen), hunk (@hunk-fe), @daiping0323, @forczc, AND cooptest, do you see a screen that says Semantic Kernel service up and running when you navigate to https://localhost:40443/probe?

    Also, are you guys following the README exactly (spinning up the webapi and WebApp locally) or are you using one of the deployment templates to deploy Semantic Kernel to Azure?

  10. cooptest commented on May 17, 2023

    @cooptest

    Deploy and install locally (http://localhost:3000)

    I can start successfully and get a response

    You cannot log in to Copilot chat with the same account as the Azure subscription, you need to change another account, otherwise an error will be reported no matter what content is sent

    Is there any plan to deploy the configuration on the server? Now it can only be accessed on localhost, but I want to access it through the server IP on the Internet

  11. Tangroo commented on May 18, 2023

    @Tangroo

    Hi doolachen (@doolachen), hunk (@hunk-fe), @daiping0323, @forczc, AND cooptest, do you see a screen that says Semantic Kernel service up and running when you navigate to https://localhost:40443/probe?

    Also, are you guys following the README exactly (spinning up the webapi and WebApp locally) or are you using one of the deployment templates to deploy Semantic Kernel to Azure?

    I get the same problem! I deployed strictly according to README. Is it necessary to deploy the Semantic Kernel to Azure and then deploy the copilot chat locally?Or simply deploy the copilot chat app locally?

  12. Tangroo commented on May 18, 2023

    @Tangroo

    https://github.com/microsoft/semantic-kernel#sample-apps-
    In the second requirement, it says that you need to configure the Azure Functions Core Tools. Do you need to deploy this tool locally ahead of time? Despite installing the tool, I still see the same error message.

  13. teresaqhoang commented on May 18, 2023

    @teresaqhoang
    Contributor

    Hi doolachen (@doolachen), hunk (@hunk-fe), @daiping0323, @forczc, AND cooptest, do you see a screen that says Semantic Kernel service up and running when you navigate to https://localhost:40443/probe?
    Also, are you guys following the README exactly (spinning up the webapi and WebApp locally) or are you using one of the deployment templates to deploy Semantic Kernel to Azure?

    I get the same problem! I deployed strictly according to README. Is it necessary to deploy the Semantic Kernel to Azure and then deploy the copilot chat locally?Or simply deploy the copilot chat app locally?

    Hey Tangroo (@Tangroo), It is not necessary to deploy the webapi to Azure, running it locally should work fine!

    In the second requirement, it says that you need to configure the Azure Functions Core Tools. Do you need to deploy this tool locally ahead of time? Despite installing the tool, I still see the same error message.

    Copilot Chat actually doesn't require Azure Functions Core Tools (our bad, we should update the documentation). The other sample apps leverage the KernelHttpServer as the service API, and it's deployed against Azure Function Runtime, so those tools are required there to run the service locally. Copilot uses an Asp.Net web application to expose SK APIs.

  14. 2 remaining items

  15. Tangroo commented on May 19, 2023

    @Tangroo

    cooptest Tangroo (@Tangroo) I'm unable to reproduce this issue. Do you guys have the latest changes pulled? We've pushed a lot of bug fixes in the past week

    Yes, I pulled the latest code and cloned it again yesterday. However, if I redeploy it, I will still report the same error.

  16. teresaqhoang commented on May 19, 2023

    @teresaqhoang
    Contributor

    cooptest Tangroo (@Tangroo) I'm unable to reproduce this issue. Do you guys have the latest changes pulled? We've pushed a lot of bug fixes in the past week

    Yes, I pulled the latest code and cloned it again yesterday. However, if I redeploy it, I will still report the same error.

    Can you send a screenshot of the error? We no longer have the getAudienceMemberForId method, so I’m wondering what the stack looks like now.

  17. Tangroo commented on May 19, 2023

    @Tangroo

    image
    the webapi started successfully.
    image
    When the webapp is just opened, it is also in a normal state
    image
    When I send a message to it, it jumps directly to this error page

  18. BeiPoer commented on May 19, 2023

    @BeiPoer

    I have the same issue as Tangroo (@Tangroo), and I noticed there is an error with this request on the network.
    ur: https://localhost:40443/chat
    image

  19. coopliu commented on May 19, 2023

    @coopliu

    cooptest Tangroo (@Tangroo) I'm unable to reproduce this issue. Do you guys have the latest changes pulled? We've pushed a lot of bug fixes in the past week

    No, I changed a Microsoft account and logged in to Copilot Chat again, it can run successfully and receive a reply
    1

  20. BeiPoer commented on May 19, 2023

    @BeiPoer

    cooptest Tangroo (@Tangroo) I'm unable to reproduce this issue. Do you guys have the latest changes pulled? We've pushed a lot of bug fixes in the past week

    No, I changed a Microsoft account and logged in to Copilot Chat again, it can run successfully and receive a reply 1

    me too

  21. teresaqhoang commented on May 19, 2023

    @teresaqhoang
    Contributor

    What kind of accounts were you using before? Personal? @forczc Tangroo (@Tangroo)

  22. BeiPoer commented on May 20, 2023

    @BeiPoer

    What kind of accounts were you using before? Personal? @forczc Tangroo (@Tangroo)

    yes,Personal

  23. Codingsaikou commented on May 22, 2023

    @Codingsaikou

    I changed a Microsoft account and logged in to Copilot Chat again, but cant connect to <api.openai.com>

    fail: Microsoft.SemanticKernel.IKernel[0]
    Error executing request, max retry count reached. Reason: System.Net.Http.HttpRequestException
    System.Net.Http.HttpRequestException: (api.openai.com:443)
    ---> System.Net.Sockets.SocketException (10060):
    at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
    at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
    at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
    at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
    at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    at Microsoft.SemanticKernel.Reliability.DefaultHttpRetryHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    warn: Microsoft.SemanticKernel.IKernel[0]

  24. teresaqhoang commented on May 22, 2023

    @teresaqhoang
    Contributor

    I changed a Microsoft account and logged in to Copilot Chat again, but cant connect to <api.openai.com>

    fail: Microsoft.SemanticKernel.IKernel[0] Error executing request, max retry count reached. Reason: System.Net.Http.HttpRequestException System.Net.Http.HttpRequestException: (api.openai.com:443) ---> System.Net.Sockets.SocketException (10060): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Microsoft.SemanticKernel.Reliability.DefaultHttpRetryHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) warn: Microsoft.SemanticKernel.IKernel[0]

    Hi Codingsaikou, this seems like a separate issue related to OpenAI capacity. OpenAI might have been throttled at the time you tried to connect. Can you try again? If the issue persists, please open another issue thread for help. Thanks!

  25. teresaqhoang commented on May 22, 2023

    @teresaqhoang
    Contributor

    Hi doolachen (@doolachen), hunk (@hunk-fe), @daiping0323, @forczc, cooptest, I just merged a fix into main to solve this issue.

    Turns out Msal doesn't require "name" as a required property on the account, so when it was undefined (as it is for most personal accounts), we'd see the null pointer error when trying to parse the value on the front and backend.

    I've implemented a solution that falls back to the account username if the name property is empty, so your personal accounts should work with Copilot chat now.

    Thanks for calling this to our attention and all of your help in debugging! Closing this issue. Please reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions