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

TypeError: Cannot read property 'logger' of undefined #7

Closed
moltar opened this issue Aug 3, 2020 · 5 comments
Closed

TypeError: Cannot read property 'logger' of undefined #7

moltar opened this issue Aug 3, 2020 · 5 comments

Comments

@moltar
Copy link
Contributor

moltar commented Aug 3, 2020

The following construct seems to confuse the compiler:

export class Base<C extends SharedDomainContainer = SharedDomainContainer> {
  public constructor(protected readonly container: C) {}

  /**
   * Pino logger instance.
   */
  protected readonly log = this.container.logger.child({ component: this.constructor.name })
}
    TypeError: Cannot read property 'logger' of undefined
@Brooooooklyn
Copy link
Member

Already had issue in swc: swc-project/swc#930

@moltar moltar closed this as completed Aug 3, 2020
@kdy1
Copy link
Member

kdy1 commented Aug 4, 2020

This is handled by class properties pass

@Brooooooklyn
Copy link
Member

@moltar fixed in v0.2.2

@moltar
Copy link
Contributor Author

moltar commented Aug 11, 2020

Thanks, will try again soon!

@moltar
Copy link
Contributor Author

moltar commented Aug 11, 2020

Works great! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants