Closed Saiv46 closed 5 years ago
This is only possible with:
vk.options = undefined;
Can I see the initialization code?
/** LOGGER INIT */
const DEV = process.env.NODE_ENV !== "production";
const winston = require("winston");
const {LoggingWinston} = require("@google-cloud/logging-winston");
const logger = winston.createLogger({
level: DEV ? "silly" : "info",
exitOnError: !DEV,
transports: DEV ? [
new winston.transports.Console({
format: winston.format.simple()
})] : [ new LoggingWinston() ]
});
logger.silly("Logger ready!");
logger.profile("Ready in");
/** VK INIT */
const { VK } = require("vk-io");
const { updates, api } = new VK({
language: "ru",
token: process.env.TOKEN,
pollingGroupId: +process.env.GROUPID,
apiHeaders: {"User-Agent": "Google App Engine"}
});
//const = vk;
As you can see, vk.options
is not touched at all! And polling initializating fine.
I was unable to reproduce this behavior. Can you create a separate repository with this behavior?
There were no changes, so I’ll close this issue. Feel free to open it again.
What version of
vk-io
are you using?What version of Node.js are you using?
What did you do?
Added logging system, one middleware and started pooling. Then triggered the "group_join" event when bot polling started.
What did you expect to happen?
Event payload should be passed to middlewares or at least throw a VKError.
What was the actual result?
An error happens in the async cycle so the main process got terminated every time.
Logs
When debugging, the
updates.vk
(referenced atthis.vk
) is becoming "[Circular]" when handling polling update and itsoptions
property is undefined.