2

I am very new to the JS/Node js. I am having this issue with bot framework pleas help me with this.

TypeError: Cannot perform 'set' on a proxy that has been revoked at D:\Bot\Archi-bot-src\node_modules\botbuilder-core\lib\turnContext.js:360:40 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async UtilityService.communicationBuilder (D:\Bot\Archi-bot-src\resource\js\starup.js:18:7)

COde as follows:

const {
  ActivityHandler,
  MessageFactory,
  BotAdapter,
  ActivityTypes,
} = require("botbuilder");
const fs = require("fs");
const { nextTick } = require("process");
module.exports = class UtilityService {
  constructor() {
    console.log("Class created");
  }
  dummy() {}

  async communicationBuilder(str, context) {

    try {
      await context.sendActivity(MessageFactory.text('Hello!','Hellos' )); 
      await next();
    } catch (error) {
      console.log(error);

    }       
  }
};
  • That error is generally due to a message being sent after losing the async context (usually because of `setTimeout` or `setInterval`). What are you trying to accomplish with this code you have above? It doesn't look anything like any of [the samples](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs) – mdrichardson Jun 18 '20 at 16:19
  • I have created new class, from that class I am trying to send msg – dhinchak developer Jun 18 '20 at 17:39
  • Is this all of your code? If so, you should instead start with one of the samples I linked above. – mdrichardson Jun 18 '20 at 18:20
  • Hey @mdrichardson, sorry for the delayed response yes i am working with [this sample](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/02.echo-bot) trying to extend with my logic . i want to send something from another class please help me. NodeJS is really terrible dream for me!! – dhinchak developer Jun 24 '20 at 12:01
  • I'm not sure what you're trying to accomplish there. All I can really say is that the samples show you how to do pretty much anything you'd want to and how to structure it. There's also very good [documentation](https://learn.microsoft.com/en-us/azure/bot-service/?view=azure-bot-service-4.0) for most things – mdrichardson Jun 24 '20 at 16:38

0 Answers0