Property 'run' in type 'ScheduledTaskErrorEvent' is not assignable to the same property in base type

#16 [builder 5/5] RUN npx tsc
#16 9.480 src/listeners/tasks/scheduledTaskError.ts:10:9 - error TS2416: Property 'run' in type 'ScheduledTaskErrorEvent' is not assignable to the same property in base type 'Listener<"scheduledTaskError", ListenerOptions>'.
#16 9.480 Type '(error: Error, task: string, _duration: number, _payload: any) => void' is not assignable to type '(error: unknown, task: string, payload: unknown) => unknown'.
#16 9.480
#16 9.480 10 public run(error: Error, task: string, _duration: number, _payload: any) {
#16 9.480 ~~~
#16 9.480
#16 9.482
#16 9.482 Found 1 error in src/listeners/tasks/scheduledTaskError.ts:10
#16 9.482
#16 ERROR: process "/bin/sh -c npx tsc" did not complete successfully: exit code: 2
#16 [builder 5/5] RUN npx tsc
#16 9.480 src/listeners/tasks/scheduledTaskError.ts:10:9 - error TS2416: Property 'run' in type 'ScheduledTaskErrorEvent' is not assignable to the same property in base type 'Listener<"scheduledTaskError", ListenerOptions>'.
#16 9.480 Type '(error: Error, task: string, _duration: number, _payload: any) => void' is not assignable to type '(error: unknown, task: string, payload: unknown) => unknown'.
#16 9.480
#16 9.480 10 public run(error: Error, task: string, _duration: number, _payload: any) {
#16 9.480 ~~~
#16 9.480
#16 9.482
#16 9.482 Found 1 error in src/listeners/tasks/scheduledTaskError.ts:10
#16 9.482
#16 ERROR: process "/bin/sh -c npx tsc" did not complete successfully: exit code: 2
The Logs I get from this error. Any idea how I can solve this? The code:
export class ScheduledTaskErrorEvent extends Listener<typeof ScheduledTaskEvents.ScheduledTaskError> {
public run(error: Error, task: string, _duration: number, _payload: any) {
if (envIsDefined('SENTRY_DSN')) {
Sentry.withScope((scope) => {
scope.setLevel('error');
scope.setTags({ task });
scope.setFingerprint([error.name]);
scope.setTransactionName('ScheduledTaskErrorEvent');
Sentry.captureException(error);
});
}

return logErrorToContainer({ error, loggerSeverityLevel: 'error' });
}
}
export class ScheduledTaskErrorEvent extends Listener<typeof ScheduledTaskEvents.ScheduledTaskError> {
public run(error: Error, task: string, _duration: number, _payload: any) {
if (envIsDefined('SENTRY_DSN')) {
Sentry.withScope((scope) => {
scope.setLevel('error');
scope.setTags({ task });
scope.setFingerprint([error.name]);
scope.setTransactionName('ScheduledTaskErrorEvent');
Sentry.captureException(error);
});
}

return logErrorToContainer({ error, loggerSeverityLevel: 'error' });
}
}
Solution:
Update the Dependencies Change run Arguments -> public run(error: Error, task: string, _payload: unknown) ...
Jump to solution
3 Replies
Solution
chillihero
chillihero2y ago
Update the Dependencies Change run Arguments -> public run(error: Error, task: string, _payload: unknown)
Want results from more Discord servers?
Add your server