bitloops-language icon indicating copy to clipboard operation
bitloops-language copied to clipboard

Undefined import when importing VO from a DomainError

Open Varagos opened this issue 1 year ago • 0 comments

BL Example

DomainError AccountIsBlockedError(accountId:string, accountStatus: AccountStatusVO) {
    message: `Account ${accountId} is ${accountStatus.status}. Please contact support.`,
    errorId: 'DRIVER_ACCOUNT_IS_BLOCKED'
}

TS Output

import { Domain } from '@bitloops/bl-boilerplate-core';
import { AccountStatusVO } from 'undefined';
export class AccountIsBlockedError extends Domain.Error {
  static readonly errorId: string = 'DRIVER_ACCOUNT_IS_BLOCKED';
  constructor(accountId: string, accountStatus: AccountStatusVO) {
    super(
      `Account ${accountId} is ${accountStatus.status}. Please contact support.`,
      AccountIsBlockedError.errorId
    );
  }
}

I presume this is caused because when are resolving the imports, we try to find the classtype from the identifier, and perhaps we can't resolve the AccountIsBlockedError as DomainError. Could be something else though, needs investigation.

Varagos avatar May 29 '23 09:05 Varagos