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

[BetterDocs]: ts(2345) error on failed event listener from docs #2817

Open
belyaev-dev opened this issue Oct 11, 2024 · 0 comments
Open

[BetterDocs]: ts(2345) error on failed event listener from docs #2817

belyaev-dev opened this issue Oct 11, 2024 · 0 comments
Assignees

Comments

@belyaev-dev
Copy link

Version

v5.18.0

Platform

NodeJS

What happened?

Using docs example to add failed event listener causes ts(2345) error (Job is unassignable to Job | undefined)

Possible fix:

worker.on('failed', (job: Job | undefined, error: Error) => {
  // Do something with the return value.
});

How to reproduce.

worker.on('failed', (job: Job, error: Error) => {
  // Do something with the return value.
});

Relevant log output

Аргумент типа "(job: Job, error: Error) => void" нельзя назначить параметру типа "(job: Job<any, any, string> | undefined, error: Error, prev: string) => void".
  Типы параметров "job" и "job" несовместимы.
    Тип "Job<any, any, string> | undefined" не может быть назначен для типа "Job<any, any, string>".
      Тип "undefined" не может быть назначен для типа "Job<any, any, string>".ts(2345)


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@belyaev-dev belyaev-dev added the bug Something isn't working label Oct 11, 2024
@manast manast added better docs and removed bug Something isn't working labels Oct 11, 2024
@manast manast changed the title [Bug]: ts(2345) error on failed event listener from docs [BetterDocs]: ts(2345) error on failed event listener from docs Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants