Emulator in frozen state when Sending conversation messages via connectorClient
I have an application that creates a ConnectorClient and creates a direct conversation:
_connector = new ConnectorClient(new Uri(serviceUrl), account);
var botAccount = new ChannelAccount { Id = bot.Id, Name = bot.Name };
var toAccount = new ChannelAccount { Id = recipient.Id, Name = recipient.Name };
if (!MicrosoftAppCredentials.IsTrustedServiceUrl(serviceUrl)) {
throw new Exception("Cannot create conversation! Service URL is not trusted!");
}
var conversationResponse = _connector.Conversations.CreateDirectConversation(botAccount, toAccount);
return conversationResponse.Id;
I construct an object implementing IMessageActivity and attempt to send this message via the connector client:
var convoMessage = Activity.CreateMessageActivity();
convoMessage.Text = message.Message;
convoMessage.From = new ChannelAccount { Id = message.BotUser.Id, Name = message.BotUser.Name };
convoMessage.Recipient = new ChannelAccount { Id = message.Recipient.Id, Name = message.Recipient.Name};
convoMessage.Conversation = new ConversationAccount(id: conversationUid);
convoMessage.Locale = "en-Us";
convoMessage.ChannelId = message.ChannelId.ToString();
convoMessage.ServiceUrl = GetServiceUrlByChannelId(message.ChannelId);
var response = await _connector.Conversations.SendToConversationAsync((Activity)convoMessage);
I see that my post gets to the emulator successfully, but dialog does not show the text. The emulator is also frozen and will not accept any input. See the screenshot:
I have updated to bot builder c# SDK 3.5.9 and I am still seeing this behavior.
I've attempted to build the source and it failed. I installed Node V 7.10.0 and NPM 4.2.0. I've attached the log file from the attempted build. 2017-05-09T23_43_27_332Z-debug.zip
Hi @arthurtina724, did you npm install before building?
@arthurtina724 If you're successful in getting a local emulator build running in a debugger, let us know if you see anything of interest in the console output. My hunch is the emulator's node process is throwing an exception. If so, exception info should show up in the console log.
@eanders-MS I did run npm install and here is a picture of the output. Got some warning messages.
I did update botbuilder c# sdk to 3.5.9 (latest) and the issue is still happening. I'll try and get the emulator running. I'm still failing in the npm run build step. I am running on windows 10 enterprise and have VS code installed.
@eanders-MS I was not running the latest npm version. I updated to version 4.5.0 and I am still getting a build error. I've attached a log file again. 2017-05-10T17_30_41_863Z-debug.zip
It seems that gulp is not in your path. You may be able to workaround this by installing it globally. npm install -g gulp
[10:42:44] Starting 'clean'...
[10:42:44] Finished 'clean' after 12 ms
[10:42:44] Starting 'build-app'...
[10:42:45] Compiling TypeScript files using tsc version 2.1.5
[10:42:49] [tsc] > node_modules/botframework-directlinejs/built/directLine.d.ts(204,13): error TS2304: Cannot find name 'object'.
[10:42:49] Failed to compile TypeScript: Error: tsc command has exited with code:1
events.js:163
throw er; // Unhandled 'error' event
^
Error: Failed to compile: tsc command has exited with code:1
This is from running gulp directly
Hi @arthurtina724 - looks like you're using TypeScript version 2.1.5, you will need version 2.2.2. Can you install it and try again?
@danmarshall @eanders-MS typescript 2.2.2 fixed the build. Thanks. I'll try and replicate my original issue and give you guys some console info. Thanks
When I run in VS Code, the emulator is not rendering. Here is the console output: [13296:0510/110648.681:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel. [13296:0510/110648.682:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel. [13296:0510/110648.682:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel. [13296:0510/110648.682:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel. [13296:0510/110648.682:ERROR:browser_gpu_channel_host_factory.cc(125)] Failed to create channel. [13296:0510/110648.823:INFO:CONSOLE(34)] "Uncaught ReferenceError: exports is not defined", source: file:///C:/Projects/RnD/BotFramework-Emulator/app/client/index.js (34)
@eanders-MS I tried out 3.5.29 just now and I am not able to replicate my original issue. I still would like to run the emulator locally. Do you guys list the versions of dependencies anywhere? ie. typescript 2.2.2. I feel like my setup is a bit screwy.
Actually, I think this is a bug on our side. It looks like the emulator's dependencies are a bit out of date. There's a typescript version mismatch between what we use to build the emulator and what some of our dependent modules require. We'll get a fix in shortly.
Ok, we've made a fix. Can you pull latest and rebuild?
@danmarshall @eanders-MS I pulled the latest and can confirm it runs and successfully communicates with my bot application. Thanks for the help guys.
*I also wanted to confirm that release 3.5.29 is working fine as well. I am not able to replicate that issue.