Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'logger') #160

Open
brianferri opened this issue Oct 27, 2023 · 1 comment
Open

Cannot read properties of undefined (reading 'logger') #160

brianferri opened this issue Oct 27, 2023 · 1 comment
Labels
bug Something isn't working djs-bot Issue with backend good first issue Good for newcomers

Comments

@brianferri
Copy link
Member

Frequent:

djs-bot    | [27:9:2023 - 20:49] [ERROR] | [FATAL] Possibly Unhandled Rejection
djs-bot    |    Reason: TypeError: Cannot read properties of undefined (reading 'logger')
djs-bot    |
djs-bot    | Promise {
djs-bot    |   <rejected> TypeError: Cannot read properties of undefined (reading 'logger')
djs-bot    |       at warn (/djs-bot/lib/Bot.js:72:8)
djs-bot    |       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
djs-bot    |       at async /djs-bot/util/controlChannel.js:146:22
djs-bot    | }

Cause:

.catch(client.warn);

Verify correct export in:

const Bot = require('./lib/Bot');
const client = new Bot();
module.exports.getClient = () => client;

Error is referring to:

warn(...data) {
this.logger.warn(data);
}

@brianferri brianferri added bug Something isn't working djs-bot Issue with backend good first issue Good for newcomers labels Oct 27, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working djs-bot Issue with backend good first issue Good for newcomers
Projects
Status: Planned changes & updates
Development

No branches or pull requests

1 participant